Re: require_once problem
| From: | Greg Beaver | Date: | Wed, 09 Feb 2005 15:36:17 +0000 |
| Subject: | Re: require_once problem | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-36091@lists.php.net to get a copy of this message | ||
Sebastian Bergmann wrote:
Bug #3402 [1] took me a while to figure out but now I tracked it down to a problem with require_once that I would like to share with you in hope for a general solution. In the following diagram "a -> b" means that there is a require_once call for the sourcefile of class b in the sourcefile of class a: TestCase -> TestResult -> TestSuite -> Warning -> TestCase By the time Warning requires TestCase the TestCase class has not been declared but its sourcefile has been loaded and require_once treats it (correctly) as included. Any idea on how to elegantly solve this would be appreciated, SebastianHi Sebastian, Move the require_once '...Warning.php' to the bottom of TestCase.php, after all classes have been declared. Greg