Seeing this: > function add( ... ): float {} I think a much better choice would have been: > float function add( ... ) {} Or just: > float add( ... ) {} Since that's how it's done in other languages and people would feel at home with it.
Things you should know about PHP 7
21–30 of 124 posts
Re: Things you should know about PHP 7
#22TL;DR: 1. Scheduled to come out in Q4 2015 2. operator, see https://wiki.php.net/rfc/combined-comparison-operator 3. Return Type Declarations & Scalar Type Hints 4. Speed improvements (25-70%) 5. Yep, speed improvements are for real. You're welcome.
So 1 is not a feature, 4 & 5 are the same thing (and maybe a consequence of 3) while 2 can be remplaced by a single function. Seems like the only new feature are type hints. Looks like Hack has been rebranded as PHP 7.
Re: Things you should know about PHP 7
#23Heck, I'm kinda felling bad as a Pythonista. We're lagging badly speed wise. Sure, there's PyPy but it's not compatible with the mainstream C-Extensions so pretty much a no-go for most of my projects. Hopefully Piston will come to rescue in the future.
Re: Things you should know about PHP 7
#24Earlier quoted context omitted.
> 1. Scheduled to come out in Q4 2015 ... and available on general cheap webhosting sometime around 2020. If we're lucky. Thank god our company slowly moved away from building small PHP websites that have to run on the most fucked up PHP installations from the before-time. Now it's PHP 5.6+ everywhere :-)
>... and available on general cheap webhosting sometime around 2020. If we're lucky. Shared Hosting needs to die off anyway.
Shared Hosting has many downsides, but it still fills an incredibly important niche for businesses for whom a web presence beyond a Facebook page is needed but real managed hosting is completely out of their price range.
Re: Things you should know about PHP 7
#25Seeing this: > function add( ... ): float {} I think a much better choice would have been: > float function add( ... ) {} Or just: > float add( ... ) {} Since that's how it's done in other languages and people would feel at home with it.
Haxe uses the first syntax, as does AS3. So it's not like "other languages" are universally opposed to this order.
Re: Things you should know about PHP 7
#26Seeing this: > function add( ... ): float {} I think a much better choice would have been: > float function add( ... ) {} Or just: > float add( ... ) {} Since that's how it's done in other languages and people would feel at home with it.
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_decla...
Re: Things you should know about PHP 7
#27TL;DR: 1. Scheduled to come out in Q4 2015 2. operator, see https://wiki.php.net/rfc/combined-comparison-operator 3. Return Type Declarations & Scalar Type Hints 4. Speed improvements (25-70%) 5. Yep, speed improvements are for real. You're welcome.
Re: Things you should know about PHP 7
#28Re: Things you should know about PHP 7
#29Seeing this: > function add( ... ): float {} I think a much better choice would have been: > float function add( ... ) {} Or just: > float add( ... ) {} Since that's how it's done in other languages and people would feel at home with it.
Haxe uses the first syntax, as does AS3. So it's not like "other languages" are universally opposed to this order.
But then, it wouldn't be PHP if it was too consistent ;).
Re: Things you should know about PHP 7
#30Seeing this: > function add( ... ): float {} I think a much better choice would have been: > float function add( ... ) {} Or just: > float add( ... ) {} Since that's how it's done in other languages and people would feel at home with it.