Hall of Famer Posted November 19, 2012 Share Posted November 19, 2012 (edited) Surprised that I did not come across a discussion thread here, so I decide to bring one up. PHP 5.5.0 Alpha1 released 15-Nov-2012 The PHP development team announces the immediate availability of PHP 5.5.0alpha1. This release marks the beginning of the PHP 5.5.0 release cycle. All users of PHP are encouraged to test this version carefully' date=' and report any bugs in the bug tracking system.THIS IS A DEVELOPMENT PREVIEW - DO NOT USE IT IN PRODUCTION! PHP 5.5.0 Alpha 1 comes with new features such as (incomplete list) : support for Generators, a new password hashing API, support for finally in try/catch blocks support for list() in foreach, constant array/string dereferencing, ext/intl improvement. We also dropped support for Windows XP and 2003. You can read the full list of changes in the NEWS file contained in the release archive. For source downloads of PHP 5.5.0 Alpha 1 please visit the download page, Windows binaries can be found on windows.php.net/qa/. Thank you for helping us making PHP better. Looks like lots of solid additions, although it does not look as exciting as PHP 5.3 and 5.4's initial releases. Whats your thought? I was expecting syntax like this below to be made possible in PHP 5.5, too bad its not happening and we still have to use the constructor to initiate properties as objects: class Foo{ } class Bar{ public $foo = new Foo(); } Edited November 19, 2012 by Hall of Famer Quote Link to comment https://forums.phpfreaks.com/topic/270924-php-550-alpha-1-released/ Share on other sites More sharing options...
KevinM1 Posted November 19, 2012 Share Posted November 19, 2012 What do they mean by 'Generator'? Coroutines is an interesting addition. Disappointed they haven't embraced property syntax. Quote Link to comment https://forums.phpfreaks.com/topic/270924-php-550-alpha-1-released/#findComment-1393660 Share on other sites More sharing options...
Adam Posted November 19, 2012 Share Posted November 19, 2012 (edited) https://wiki.php.net/rfc/generators I like this idea. https://wiki.php.net/rfc/password_hash Not overly keen on the proposed API, but a welcome addition. https://wiki.php.net/rfc/finally Probably useful, but not something I've ever really thought I needed. https://wiki.php.net/rfc/foreachlist This will definitely come in handy. https://wiki.php.net/rfc/constdereference Don't really see the need for this, when would you ever need to do any of it? I guess as mentioned it's just for consistency though. Can't seem to find the RFC for the international improvements, but I don't really do anything like that any more so I can't see it having much impact on me. At least not right now. I was expecting syntax like this below to be made possible in PHP 5.5, too bad its not happening and we still have to use the constructor to initiate properties as objects: class Foo{ } class Bar{ public $foo = new Foo(); } But what about arguments, where do they come from? Would they have to be argument-less objects only? How often do you create an object that doesn't have arguments? Seems like it would be a lot of changes for something that doesn't really serve much use, or make a lot of sense. Edited November 19, 2012 by Adam Quote Link to comment https://forums.phpfreaks.com/topic/270924-php-550-alpha-1-released/#findComment-1393665 Share on other sites More sharing options...
Hall of Famer Posted November 20, 2012 Author Share Posted November 20, 2012 (edited) But what about arguments, where do they come from? Would they have to be argument-less objects only? How often do you create an object that doesn't have arguments? Seems like it would be a lot of changes for something that doesn't really serve much use, or make a lot of sense. umm why? I do not see this is a problem. You pass whatever parameter into the object as you want. It works out with not only object without arguments, but also situations in which your arguments are integers, strings or boolean values. An example is given below: class Foo{ public $string; private $integer; public function __construct($str, $int){ $this->string = $str; $this->integer = $int; } public function getInt(){ return $this->int; } } class Bar{ public $foo = new Foo("This is a string", 1); public function print(){ echo $this->foo->string; echo "<br>"; echo $this->foo->getInt(); } } $bar = new Bar; $bar->print(); // prints "This is a string" in line 1, and "1" in line 2. Well yeah, it can get tricky if your object properties need variable arguments, it can also be achieved using dependency injection. Edited November 20, 2012 by Hall of Famer Quote Link to comment https://forums.phpfreaks.com/topic/270924-php-550-alpha-1-released/#findComment-1393702 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.