Re: is_a, instanceof, conclusion

From: Date: Sat, 20 Aug 2005 12:11:42 +0000
Subject: Re: is_a, instanceof, conclusion
References: 1 2 3 4 5 6 7 8 9  Groups: php.internals 
Request: Send a blank email to internals+get-18234@lists.php.net to get a copy of this message
Hello Derick, Saturday, August 20, 2005, 10:54:38 AM, you wrote: > On Fri, 19 Aug 2005, Andi Gutmans wrote: >> Dmitry commited the updated instanceof to HEAD. I suggest to merge it into >> PHP_5_1 as many want it and it's an extremely low risk patch. >> If people object, we can put it into 5.1.1. > I saw he made instanceof NOT use autoload anymore. I'm not sure if that > is such a good idea, as I'm wondering whether the following will work: > file a.php: > <?php > interface A { > } ?>> > file b.php: > <?php > class B implements A { > } ?>> > index.php: > <?php > function __autoload($name) { > require $name. '.php'; That should read: require strtolower($name) . '.php'; > } > $f = new b(); That should read new B() :-) anyway the above line autoloads a.php. Class a gets compiled so b.php gets autoloaded, too. > if ($f instanceof A) With the above A is already loaded as well as B. > { > $f->doInterfaceFoo(); > } ?>> > regards, > Derick Best regards, Marcus

« previous php.internals (#18234) next »