Hi all, I just wrote an article about PHP5 which should be out in a few days at developer.com (..shameless plug..)
Some things I like tremendously.. the __autoload() features, interfaces, inheritance and overloading, the access modifiers and namespaces are cool too!, and I have a feeling Zeev will actually get through the introspection unscathed, albeit with lots of caffeine.
I think it is more than a glorified PHP4 tho, since the Zend 2 engine is considerably faster than PHP4 because less copying is going on, especially with large objects, and there is some (although limited) pre-compiling going on under the hood.
Someone asked about the 4.5 branch.. this will just be a maintenace release for bug fixes and is basically deprecated already... they have already said that over there at Zend
Yes, the double underscopes, colons, and running()->function()->calls() will be more for a newbie, but EVERY php release has had more and more...
The exception handling won't break BC with PHP4, thats a tenet and it will speed up our code-handling of errors on a global basis, and the addition of constants and statics makes php5 that more ecure in an OO environment... especially when your are working with templated code for the enterprise.
Well thats my 2cents.. btw.. PHP5' latest snap went in without a hitch on my IIS5/xp "play-box', so go to snaps.php.net and try it if you have a free serveror workstation capable of running it.
here's some lite code for lunchtime thought..
<?php
interface ELGTextEdit {
function replaceText();
function uC();//uppercase
function lC();//lowercase
}
class ELGText implements ELGTextEdit {
protected $text;
// Method declarations
// First the constructor
function __contruct() {
$this->text = "ERIC IS COOL!";
}
function display(){
return $this->text;
}
function replaceText($s){
$this->text = $s;
}
function uC(){
$this->text = strToUpper($this->text)."<br>";
}
function lC(){
$this->text = strToLower($this->text)."<br>";
}
}
class MissingArgumentException
{
function __construct($e)
{
$this->e = $e;
}
function toString()
{
return 'A MissingArgumentException occurred : ' . $this->e;
}
}
$elg = new ELGText();
$elg->replaceText("YOUR COOL");
$elg->lC();
echo $elg->display();
$elg->uC();
echo $elg->display();
try{
throw new MissingArgumentException("<br>You must specify the text to replace");
} catch (MissingArgumentException $e){
echo $e->toString();
}
?>
[EDIT=Added PHP tags for syntax highlight]