Rob HudsonWed Jul 28 23:34:33 PDT 2004
What's "kicky"?
I'm interested in what you think. PHP4's object model was pretty bad.
I've heard references saying that one of the guys from Zend (Andi?)
basically added objects to PHP4 in one afternoon. It was an
afterthought and they didn't think it would be used as heavily as it
was.
So, when it was time to think about PHP5, they started thinking about
objects at the very beginning. And they looked at other languages for
guidance, the major one being Java.
Personally, I'm looking forward to PHP5's more complete object model.
There are also some other features that make PHP5 look attractive. The
new XML support (based on libxml2). Here's a nice article:
http://www.php-mag.net/itr/online_artikel/psecom,id,503,nodeid,114.html
Also, with PHP5 and MySQL 4.1, there is a new mysqli extension that
really adds a lot of nice new features to the mysql extension. Prepared
statements, data binding both going in and coming out. Stuff like that.
Things Perl's DBI has had for a long time...
http://www.zend.com/php5/articles/php5-mysqli.php
But somethings don't look quite solid yet like the PHP5 "magic method"
"__toString()". Python has one of these you can define that, when you
print the object, it calls this function. PHP has it but it doesn't
work in some places:
print $ojb; // this works
print "This is my object: $obj"; // this doesn't
$objstr = (string) $obj; // casting: this doesn't work either
But, I think they're going to try to clean this up in 5.1
Just my summary of what I've learned. :)
-Rob
On 20040728.2140, larry price said ...
> It's practically a different language
> see http://www.php.net/manual/en/migration5.oop.php
>
> It looks like it's trying to become Java
> what with Interfaces, and
> public|protected|private method declarations
> also they appear to have copied some of the iterator stuff from python
>
> but hey, its at least got an object model that doesn't suck.
>
> I'm upgrading my webserver now.
>
> So i'll poke at it and give a full report (and demo )in a few days
>
>
>
> --
> http://Zoneverte.org -- information explained
> Do you know what your IT infrastructure does?
> _______________________________________________
> EUGLUG mailing list
> euglug at euglug.org
> http://www.euglug.org/mailman/listinfo/euglug