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

From: Date: Mon, 26 Apr 2004 18:42:00 +0000
Subject: #28167 [Opn]: Stack trace and a static method
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-58818@lists.php.net to get a copy of this message
ID: 28167 User updated by: jaguargordon at free dot fr Reported By: jaguargordon at free dot fr Status: Open Bug Type: Class/Object related Operating System: Windows XP SP1 PHP Version: 5CVS-2004-04-26 (dev) New Comment: title ... Previous Comments: ------------------------------------------------------------------------ [2004-04-26 20:37:27] jaguargordon at free dot fr 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 this bug report at http://bugs.php.net/?id=28167&edit=1

« previous php.bugs (#58818) next »