Re: Re: Bug/Req:#61422&#39003 enble Type Hint autoloading

From: Date: Tue, 01 May 2012 22:53:56 +0000
Subject: Re: Re: Bug/Req:#61422&#39003 enble Type Hint autoloading
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-60407@lists.php.net to get a copy of this message
Hi! > Because Foo_Bar could be *defined* under a different name, say, > Foo_Blah. Then, as soon as someone needed Foo_Bar, we would use > class_alias to add an alias. That is, as soon as someone tried using class_alias is a dirty hack. instanceof implies that the object is an instance of specific class. If the class is not loaded, no object can be an instance of it. So no autoloading is necessary. > Foo_Bar it would turn out that Foo_Bar and Foo_Blah are the same class > and all Foo_Blah objects are *also* Foo_Bar objects and everything is > cool. Therefore foo(new Foo_Blah()) would work (if there was autoload). > > Please see the demo I provided at > https://bugs.php.net/bug.php?id=61422 I do not see how anything good can come out of encouraging stuff like this. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227

« previous php.internals (#60407) next »