Jump to content


Photo

Php 5.5.0 Alpha 1 Released...


  • Please log in to reply
3 replies to this topic

#1 Hall of Famer

Hall of Famer

    OOP Fanboi

  • Members
  • PipPipPip
  • 315 posts
  • LocationIthaca

Posted 19 November 2012 - 05:00 PM

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, 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, 19 November 2012 - 05:00 PM.

Welcome to the world of OOPHP! In a perfect script, everything is an object. You cannot be perfect, but you can approach as close as can.

zog841.jpg


#2 KevinM1

KevinM1

    Snarkimus Prime

  • Moderators
  • 5,243 posts
  • LocationNew Hampshire, USA

Posted 19 November 2012 - 05:22 PM

What do they mean by 'Generator'?

Coroutines is an interesting addition.

Disappointed they haven't embraced property syntax.

#3 Adam

Adam

    Advanced Member

  • Gurus
  • 5,695 posts
  • LocationSheffield / UK

Posted 19 November 2012 - 05:48 PM

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...onstdereference
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, 19 November 2012 - 05:52 PM.


#4 Hall of Famer

Hall of Famer

    OOP Fanboi

  • Members
  • PipPipPip
  • 315 posts
  • LocationIthaca

Posted 20 November 2012 - 12:10 AM

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, 20 November 2012 - 12:11 AM.

Welcome to the world of OOPHP! In a perfect script, everything is an object. You cannot be perfect, but you can approach as close as can.

zog841.jpg





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com