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 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php