Jump to content

Php 5.5.0 Alpha 1 Released...


Hall of Famer

Recommended Posts

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 by Hall of Famer
Link to comment
Share on other sites

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 by Adam
Link to comment
Share on other sites

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 by Hall of Famer
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.