class A { function f() { echo "1"; } }
class B { function f() { echo "2"; } }
$b = new B();
How do I inherit f() from A to B so that $b->f(); echoes "12" (in other words, can super calls be done in PHP and how)?
It's not real clean in PHP. (Zend guys, listening, IT'S NOT REAL CLEAN!) But you can do:
class B { function f() { $x=A::f(); echo $x."2"; } }
HTH, Cal Cal Evans - Senior Internet Dreamer - Techno-Mage - Last of the great Internet Burma-Shave poets. http://www.calevans.com *
Clean?!? How the Hell did you find this? I tried $super->f() and stuff... :-))
Thank you so very much!
🙂 I saw someone else do it. 🙂 (I wish I could remember who, I would credit them.
Glad I could help. Cal
Cal Evans - Senior Internet Dreamer - Techno-Mage - Last of the great Internet Burma-Shave poets. http://www.calevans.com *