Re: Exceptions: Error Codes Vs Class Names

From: Date: Sun, 29 Aug 2004 01:46:27 +0000
Subject: Re: Exceptions: Error Codes Vs Class Names
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-33028@lists.php.net to get a copy of this message
This should be faster: static $x = new My_Package_Exception throw $x
Why is this faster? doing "new XXXX", involves quite a bit of method calling / memory allocation..
where as this just creates a single zval + refcounts the exception instance.. Slight snag is that it doesnt call the constructor (so the hooks in PEAR_Exception that call observors would not work..) Regards Alan
- Davey
     


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