#28167 [NEW]: Stack trace and a static method

From: Date: Mon, 26 Apr 2004 18:37:28 +0000
Subject: #28167 [NEW]: Stack trace and a static method
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-58816@lists.php.net to get a copy of this message
From: jaguargordon at free dot fr Operating system: Windows XP SP1 PHP version: 5CVS-2004-04-26 (dev) PHP Bug Type: Class/Object related Bug description: Stack trace and a static method Description: ------------ The stack trace feature seams to mishandle static methods when a exception is raised. Reproduce code: --------------- <pre><?php class MyException extends Exception { function raise() { throw new MyException; } static function raiseStatic() { throw new MyException; } } function dontwork() { return false; } class Foo { function bar() { $v = @dontwork() or MyException::raise(); } function barStatic() { $v = @dontwork() or MyException::raiseStatic(); } } $foo = new Foo; try { $foo->bar(); } catch( Exception $e ) { echo $e; echo "\n\n"; } try { $foo->barStatic(); } catch( Exception $e ) { echo $e; echo "\n\n"; } ?></pre> Expected result: ---------------- exception 'MyException' in C:\www\static.php:6 Stack trace: #0 C:\www\static.php(19): MyException::raise() #1 C:\www\static.php(29): Foo->bar() #2 {main} exception 'MyException' in C:\www\static.php:10 Stack trace: #0 C:\www\static.php(23): MyException::raiseStatic() #1 C:\www\static.php(32): Foo->barStatic() #2 {main} Actual result: -------------- exception 'MyException' in C:\www\static.php:6 Stack trace: #0 C:\www\static.php(19): Foo->raise() #1 C:\www\static.php(29): Foo->bar() #2 {main} exception 'MyException' in C:\www\static.php:10 Stack trace: #0 C:\www\static.php(23): MyException::raiseStatic() #1 C:\www\static.php(32): Foo->barStatic() #2 {main} -- Edit bug report at http://bugs.php.net/?id=28167&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28167&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28167&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=28167&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=28167&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=28167&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=28167&r=needscript Try newer version: http://bugs.php.net/fix.php?id=28167&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=28167&r=support Expected behavior: http://bugs.php.net/fix.php?id=28167&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=28167&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=28167&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=28167&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28167&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=28167&r=dst IIS Stability: http://bugs.php.net/fix.php?id=28167&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=28167&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=28167&r=float

« previous php.bugs (#58816) next »