Big hitters: array dereferencing - $object->method()[$index] is now valid syntax built-in webserver via CLI - php -s - http://php.net/manual/en/features.commandline.webserver.php traits and the insteadof operator - http://php.net/language.oop5.traits.php shortened array syntax - $array = [1, 2, [1, 2, 3], 4]; Finally removed register_globals ;) Default charset of UTF-8! Read all about it! http://www.php.net/manual/en…
Also it is faster and much better on memory consumption (depends on app of course, but 10-20% speedup and 20-30% less peak memory have been observed on some mainstream apps).
PHP 5.4.0 released
51–60 of 103 posts
Re: PHP 5.4.0 released
#52Earlier quoted context omitted.
Also it is faster and much better on memory consumption (depends on app of course, but 10-20% speedup and 20-30% less peak memory have been observed on some mainstream apps).
Are these numbers based on most previous versions of PHP? I'm on 5.3.10, do you think if I upgraded I would see similar improvements?
Re: PHP 5.4.0 released
#53Earlier quoted context omitted.
I always thought it was weird and kind of stupid, but I'm genuinely curious how is that great thing. How is it weird and stupid? is better than ?
Good tools complain about <?= because it does not start with a named target. A lot of people just haven't read about the idea behind processing instruction syntax, which is also why we keep seeing mistakes like <%.
Re: PHP 5.4.0 released
#54This is a nice list of improvements. As someone who spends a lot of the day in PHP-land, this is going to make me happy. As someone who also controls our entire server stack, waiting for someone else to decide to upgrade will not be a problem :) I'm glad the PHP devs are starting to actually make it a "real" language. It seems like PHP has always been the fat kid bumbling along behind everyone shouting "wait up guys!…
> waiting for someone else to decide to upgrade will not be a problem :) It is sad that a lot of servers are not like this, and PHP 5.4 will take ages to appear, if at all. Heck, I know of a hosting company still using PHP4.
Re: PHP 5.4.0 released
#55Earlier quoted context omitted.
The best part of short array syntax is that now you don't need named parameters to be supported by the language. function foo($opts) { echo $opts['source'] . $opts['destination']; } // just one extra pair of [] needed instead of new array() foo(['source' => '/123', 'destination' => '/abc']);
While I agree that it makes it easier to hack in that functionality, it would still be very useful to have named parameters for functions that don't implement that functionality. For example, fgetcsv takes parameters for delimiter, enclosure, and escape char (as of 5.3). Right now, if I want to specify a different enclosure, I'm forced to specify a delimiter even if I still want to use the default. I'd much prefer th…
Absolutely. But PHP devs have repeatedly refused to support named parameters so this is a good enough fix.
Re: PHP 5.4.0 released
#56I'm glad to see the short array syntax. Having strayed from PHP for a while to work on Ruby and JavaScript I'm really enjoying the ability to leave out semicolons in unambiguous end-of-line situations. Would love to see that make it into PHP at some point.
The best part of short array syntax is that now you don't need named parameters to be supported by the language. function foo($opts) { echo $opts['source'] . $opts['destination']; } // just one extra pair of [] needed instead of new array() foo(['source' => '/123', 'destination' => '/abc']);
Re: PHP 5.4.0 released
#57Re: PHP 5.4.0 released
#58One thing that's pretty important too is PHP-FPM. I've been dreaming about this for a long time for my nginx deployments. http://php-fpm.org/
Re: PHP 5.4.0 released
#59Big hitters: array dereferencing - $object->method()[$index] is now valid syntax built-in webserver via CLI - php -s - http://php.net/manual/en/features.commandline.webserver.php traits and the insteadof operator - http://php.net/language.oop5.traits.php shortened array syntax - $array = [1, 2, [1, 2, 3], 4]; Finally removed register_globals ;) Default charset of UTF-8! Read all about it! http://www.php.net/manual/en…