Live data from Hacker News

PHP 5.4.0 released

php.net

61–70 of 103 posts

Re: PHP 5.4.0 released

#61

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…

I just did a Google search for register_globals... mind boggling.

Re: PHP 5.4.0 released

#62
post #61

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…

I just did a Google search for register_globals... mind boggling.

PHP was originally designed for simple, procedural bits of logic inside individual HTML pages. In that context, there's nothing wrong with the feature itself.

Re: PHP 5.4.0 released

#63
post #61

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…

I just did a Google search for register_globals... mind boggling.

PHP was originally designed for simple, procedural bits of logic inside individual HTML pages. In that context, there's nothing wrong with the feature itself.

Re: PHP 5.4.0 released

#65
When will this be available for FreeBSD? I really can't wait for traits, short array syntax and "foo()[0]". This is really a nice upgrade. Good job PHP team!

Re: PHP 5.4.0 released

#68
post #43

This 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.

Hosting company that still uses PHP4? Name names so we can avoid and chastise them!

Re: PHP 5.4.0 released

#69

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…

I am curious what the internal hang up is which prevents: funcReturnsFunc(1)(2)

> I am curious what the internal hang up is which prevents:

PHP's parser is... not exactly a great work of software engineering.

Re: PHP 5.4.0 released

#70
post #41
post #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.

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']);

> The best part of short array syntax is that now you don't need named parameters to be supported by the language

Unless you've ever used languages with actual first-class keyword arguments (Python) and languages using hashes as pseudo-kwargs (Ruby, JavaScript). Then you know it's no substitute.

Also, you could already do just that in PHP before, it simply took 5 more characters.

Post reply on HN