Earlier quoted context omitted.
I thought that was rather odd as well. Are there many languages using this form of return type specifier?
It's fairly common in languages that determine (return) types themselves, e.g. Haskell, Scala and F# all use this syntax. Most languages that use a C-style syntax put (return) types in front. It makes very little sense for PHP. A function definition now even has both styles: `function foo(argtype arg) : rettype` instead of `function rettype foo(argtype arg)` or `function foo(arg : argtype) : rettype`.
Things you should know about PHP 7
41–50 of 124 posts
Re: Things you should know about PHP 7
#42A more comprehensive list:
- Dual-mode scalar type hints (weak by default, toggleable to strict via a per-file syntax) (https://wiki.php.net/rfc/scalar_type_hints_v5)
- Return type declarations (https://wiki.php.net/rfc/return_types)
- operator (https://wiki.php.net/rfc/combined-comparison-operator)
- Null coalesce operator (??) (https://wiki.php.net/rfc/isset_ternary)
- Closure::call (https://wiki.php.net/rfc/closure_apply)
- Abstract syntax tree (https://wiki.php.net/rfc/abstract_syntax_tree)
- Context sensitive lexer, allowing the use of reserved words in more places (https://wiki.php.net/rfc/context_sensitive_lexer)
- Unicode escape syntax in strings (https://wiki.php.net/rfc/unicode_escape)
- A uniform variable syntax (https://wiki.php.net/rfc/uniform_variable_syntax)
- Expectations (https://wiki.php.net/rfc/expectations)
- Use declaration grouping (https://wiki.php.net/rfc/group_use_declarations)
- Removal of a ton of long-deprecated features
- Massive speed improvements
You can see everything that's been added to PHP 7 on https://wiki.php.net/rfc (look under Accepted and Implemented - PHP 7.0)
Re: Things you should know about PHP 7
#43Earlier 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.
This is like saying "Bicycles need to die out." just because you never ride one.
Disclaimer: I work for a web hosting company.
Re: Things you should know about PHP 7
#44TL;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.
Which won't happen, I can tell you. PHP's release dates always slip by at least a month, and that's without a very unstable master branch like PHP 7 has.
If it does happen, it'll take a few micro (7.0.x) releases until it reaches stability.
> 3. Return Type Declarations & Scalar Type Hints
Also strict scalar typing:
However, Zend not mentioning this is to be expected. The company's founders (Zeev Suraski, Andi Gutmans) and employees (Dmitry Stogov and some others) are some of the biggest opponents of strict typing in PHP.-- disclaimer: I am a former PHP internals developer
Re: Things you should know about PHP 7
#45"You can put lipstick on a pig but it's still a pig" - Barack Obama on PHP in 2008
Barack Obama? Do you mean the most famous of the most brilliant hackers? https://www.whitehouse.gov/blog/2014/12/10/president-obama-f...
println('I\'m fly, super high');Re: Things you should know about PHP 7
#46Good to see PHP slowly improving, although I haven't used it for years now. On a side note, does anyone know why Drupal 8 is apparently so absurdly slow? I know it's not entirely fair to compare against D7 as it's still technically "under development" but it just seems insane to take that much of a performance hit for nicer OOP semantics...
D8's a work in progress, and if there's one thing I wouldn't be too critical of a wip for, it's performance. Frankly I don't really see drupal's place in the world anymore. It's so absurdly config-heavy, which may have made sense a decade ago but not now. Everyone will just install composer, put laravel/symfony on there, and be off to the races. The era of giant pages of drupal-managed plugins is over, and replaced b…
Re: Things you should know about PHP 7
#47TL;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.
The speed boost is due to massive engine changes and internal refactoring.
Re: Things you should know about PHP 7
#48Earlier quoted context omitted.
Well, maybe you should review your stack. Which C extensions are you missing? There are alternatives for the most part (barring GUI)
The ones I miss most frequently are a faster json parser (I use ujson), a faster msgpack parser and a faster database driver. The pure python versions (even on PyPy) don't make the cut :(
Re: Things you should know about PHP 7
#49Earlier quoted context omitted.
Haxe uses the first syntax, as does AS3. So it's not like "other languages" are universally opposed to this order.
AFAICT both Haxe and AS3 consistently put types on the right, including argument declarations. Other languages consistently put it on the left. Most languages make a choice like that; PHP mixes things up a bit. But then, it wouldn't be PHP if it was too consistent ;).
Re: Things you should know about PHP 7
#50Earlier quoted context omitted.
It's also completely blank without javascript.
Why are you not running javascript? Is it a environment restriction, out of security concern or personal preference? Since tone can be tricky on the internet I'll just add that I am genuinely curious about this.
It tends to be a classic case of blaming the tools for the actions of the people using them.