From: davojan at mail dot ru Operating system: FreeBSD 4.7-RELEASE PHP version: 5.0.0b3 (beta3) PHP Bug Type: Zend Engine 2 problem Bug description: -> causes error message, while exception was raised in __get
Description: ------------ As I imagine, PHP must not check bar's type in $foo->bar->get_name() call, if bar is a result of __get() function and an exception was raised in it. However it does so. The example below works fine, if we comment the "throw" line - the result in browser is 'bar'. Reproduce code: --------------- <? class bar { function get_name() { return 'bar'; } } class foo { function __get($sName) { throw new Exception('Exception!'); return new bar(); } } $foo = new foo(); try { echo $foo->bar->get_name(); } catch (Exception $E) { echo 'Exception raised!'; } ?> Expected result: ---------------- Exception raised! Actual result: -------------- Fatal error: Call to a member function get_name() on a non-object in /usr/local/www/data-dist/ils/admin/test/get_ex.php on line 15 -- Edit bug report at http://bugs.php.net/?id=26866&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26866&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26866&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=26866&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=26866&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=26866&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=26866&r=needscript Try newer version: http://bugs.php.net/fix.php?id=26866&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=26866&r=support Expected behavior: http://bugs.php.net/fix.php?id=26866&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=26866&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=26866&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=26866&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26866&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=26866&r=dst IIS Stability: http://bugs.php.net/fix.php?id=26866&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=26866&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=26866&r=float