3 ms·
The idea is that the old php syntax "function foo ()" remains unchanged [1] so developers can keep searching for "function foo". Removing "function" as keyword
by juriansluiman 12y ago
The idea is that the old php syntax "function foo ()" remains unchanged [1] so developers can keep searching for "function foo". Removing "function" as keyword is a different topic and is discussed in a separate php thread [2].
The thing you mention ("float function add(){}") keeps the option to search for "function add", but I am unsure why this is not taken into account in this proposal.
Anyhow, I am pretty happy this finally made it to the php language.
[1] https://wiki.php.net/rfc/return_types#position_of_type_declaration https://wiki.php.net/rfc/return_types#position_of_type_decla...
[2] http://marc.info/?t=141235344900003&r=1&w=2 http://marc.info/?t=141235344900003&r=1&w=2
- steveklabnik 12y agoHaving 'function foo' be grep-able is _wonderful_. My last language, Ruby, isn't very grep-able, but my current one, Rust, uses 'fn foo', and being able to just use 'git grep' to find things is _wonderful_.