Re: Two Parser Passes

From: Date: Sat, 31 Oct 2009 22:02:43 +0000
Subject: Re: Two Parser Passes
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-299548@lists.php.net to get a copy of this message
Steve wrote: > Daniel Kolbo wrote: >> Hello, >> >> Is it possible to get a list (array) of classes not found in a script >> before the fatal error exits the parser. I realize that PHP parses the >> script twice. It would be nice at the end of the first parsing pass to >> check to see which classes haven't been defined (yet), so that I could >> define them before the second pass. This way I could load only those >> classes a script needs. >> >> Thanks in advance, >> dK >> ` >> > It sounds like you are looking for autoload: > http://www.php.net/manual/language.oop5.autoload.php > Mr. Steve that's pretty cool. Thanks. Is there a similar type function for autoloading undefined functions? Thanks, dK `

« previous php.general (#299548) next »