From: [EMAIL PROTECTED] Operating system: * PHP version: 5CVS-2006-08-28 (CVS) PHP Bug Type: Scripting Engine problem Bug description: Strange warning when throwing an exception from a __set method.
Description: ------------ When throwing an exception from a __set() method a strange fatal error is shown. I would expect to see the uncaught exception error. Even if I put a try/catch around the $impl = new impl() line the same error is thrown. It seems like you can not throw exceptions if __set() is used through the constructor. Reproduce code: --------------- <?php abstract class abs { private $properties = array(); public function __set( $name, $value ) { throw new Exception( "doesn't work" ); } public function __get( $name ) { throw new Exception( "doesn't work" ); } } class impl extends abs { public function __construct() { $this->counter++; } } $impl = new impl(); ?> Expected result: ---------------- The uncaught exception fatal error. Actual result: -------------- Fatal error: Couldn't execute method impl::__set in Unknown on line 0 Call Stack: 2.6910 262144 1. {main}() /home/derick/-:0 2.6911 262144 2. impl->__construct() /home/derick/-:25 -- Edit bug report at http://bugs.php.net/?id=38624&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38624&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38624&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38624&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=38624&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=38624&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=38624&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=38624&r=needscript Try newer version: http://bugs.php.net/fix.php?id=38624&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=38624&r=support Expected behavior: http://bugs.php.net/fix.php?id=38624&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=38624&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=38624&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=38624&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38624&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=38624&r=dst IIS Stability: http://bugs.php.net/fix.php?id=38624&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=38624&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=38624&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=38624&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=38624&r=mysqlcfg