Re: PEAR-wide code quality issue (fix proposal for possible class redeclare errors)

From: Date: Tue, 25 Jul 2006 06:42:51 +0000
Subject: Re: PEAR-wide code quality issue (fix proposal for possible class redeclare errors)
References: 1 2 3 4 5 6 7  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-43560@lists.php.net to get a copy of this message
Matthew Weier O'Phinney wrote:
On 7/23/06, peter fiksman <pfiksman@gmx.net> wrote:
Hello, still one question more on this topic: why not throw an exception then, like: if (!class_exists(Class_Name)) { class Class_Name {
    // class def goes here
} } else { throw new Exception ("fatal error caught, redefining classname ... in ".__FILE__); }
Because PHP already does this by throwing a fatal error. Why reinvent the wheel?
Well he seems to want an Exception, which is catchable. However instead of writing code to catch he should just do a class_exists() check before doing the require. regards, Lukas

« previous php.pear.dev (#43560) next »