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…
Really looking forward to traits. We have some hacks using interfaces and __call that we have been using to try and approximate traits, but the real thing is always much better. :)
PHP 5.4.0 released
71–80 of 103 posts
Re: PHP 5.4.0 released
#72Big 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…
Re: PHP 5.4.0 released
#73Can it add hex now? https://bugs.php.net/bug.php?id=61095
Re: PHP 5.4.0 released
#74Added callable typehint. Nice
Re: PHP 5.4.0 released
#75Re: PHP 5.4.0 released
#76They 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!
Would love to get back into it now that it's a "real" language.
Got any good tips about books on modern PHP programming?
Re: PHP 5.4.0 released
#77Closures can now have a `$this` (by default it is the class in which the closure is declared). No more $that = $this hacks :)
[0] http://docs.php.net/manual/en/closure.bindto.php
[1] https://developer.mozilla.org/en/JavaScript/Reference/Global...
Re: PHP 5.4.0 released
#78This 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
#79Earlier quoted context omitted.
Really looking forward to traits. We have some hacks using interfaces and __call that we have been using to try and approximate traits, but the real thing is always much better. :)
I've used traits a few times and in each case replaced it later by either inheritance or moving the functionality into separate classes. I'm not getting the design considerations that call for traits over alternatives. How would one use, and why is it the better option?
Re: PHP 5.4.0 released
#80They 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!
PHP was my first love (actually my second, after QBasic) when I was a teenager. Would love to get back into it now that it's a "real" language. Got any good tips about books on modern PHP programming?
In my opinion, a big drawback of PHP is that it's so easy to screw up because it's easy to pick up. There are so many tutorials out there which will let you make a procedural, cross-scripted, sql-injected security liability spaghetti code... Starting with CodeIgniter or CakePHP is not very hard, especially when you have a little understanding on basic programming with PHP. Good luck!