I'm not new to OOP, but new to PHP. I know Java, Objective-C and some other object oriented languages. So I'm looking for a comprehensive overview of how OOP looks like in PHP.
+4
A:
Always a starting point: http://php.net/manual/en/language.oop5.php
More of a walktrough: http://net.tutsplus.com/tutorials/php/oop-in-php/
The MYYN
2009-12-22 12:21:53
A:
Unfortunately it doesn't look too great in php (compared to C or Java), php OOP is still immature IMO, V6 should bring about a nice change though.
Alot of what you may regard as standard OOP functionality might be missing, full overloading, multiple inheritance, Objective types for Date, Int and String etc.
Some functions you will no doubt make use of are the "Magic" functions __call __get __set __callStatic __sleep __wake, these may help you get around some "missing" behaviour.
Question Mark
2009-12-22 12:37:36
He's kind of correct here, OOP works in PHP but it's not efficient. Simply printing out get_memory_usage() will prove that within your OOP versus writing the code as non-OOP. Hopefully PHP6 is more efficient but I'm not very optimistic.
TravisO
2009-12-22 12:59:11
Yeah i so want 6 to be the ruby killer it deserves to be. fingers crossed.
Question Mark
2009-12-22 13:11:40