Live data from Hacker News

PHP 5.4.0 released

php.net

1–10 of 103 posts

Re: PHP 5.4.0 released

#2
They finally added short array syntax, removed register_globals and magic quotes, and the default character set is now UTF-8!

This is good news indeed, they seem to be actually improving the language for once.

Re: PHP 5.4.0 released

#5
I'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.

Re: PHP 5.4.0 released

#6
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/migration54.php

Re: PHP 5.4.0 released

#7
Other great little changes:

  - you can now do function()[0] 
  - 
Seems like a return to sanity for the PHP team, at least temporarily.. I even kinda like the traits!

Re: PHP 5.4.0 released

#8
They also improved the zend engine, CURL extension, added Tokyo cabinet abstract and Berkeley DB Support! Added a couple of hashes, Improved JSON Extension (JSON_NUMERIC_CHECK!) and a whole lot of bug fixes. The UTF-8 part was long overdue, glad they fixed that.

I spend a lot of time programming in PHP. Its reputation is pretty bad, but updates like this keep me going!

Re: PHP 5.4.0 released

#10
post #3

Are there any benchmarks (synthetic or real-world) for the performance improvements? Would have been nice if the release notes had provided some.

There are some around like http://news.php.net/php.internals/57760, seen a couple more but forget where. The trend does seem to be towards far better performance across the board though which is good.
Post reply on HN