ID: 46305 Updated by: [email protected] Reported By: jbq at caraldi dot com -Status: Open +Status: Bogus Bug Type: CGI related Operating System: * PHP Version: 5CVS-2008-10-24 New Comment:
Like said in manual page for CLI: "Note: This option is meant for a very basic stuff." http://php.net/cli What you're doing isn't basic. Previous Comments: ------------------------------------------------------------------------ [2008-10-15 15:42:56] jbq at caraldi dot com Description: ------------ When using the "-r" or "-run" command-line option to execute code, a custom exception handler is not invoked. Reproduce code: --------------- $ cat command_line_exception_handler.php <? function handler($e) { print "Caught exception " . $e->getMessage() . "\n"; } set_exception_handler("handler"); throw new Exception("Hello, World!"); Expected result: ---------------- $ php command_line_exception_handler.php Caught exception Hello, World! $ php -r "require 'command_line_exception_handler.php';" Caught exception Hello, World! Actual result: -------------- $ php command_line_exception_handler.php Caught exception Hello, World! $ php -r "require 'command_line_exception_handler.php';" Fatal error: Uncaught exception 'Exception' with message 'Hello, World!' in /home/jbq/command_line_exception_handler.php:6 Stack trace: #0 Command line code(1): require() #1 {main} thrown in /home/jbq/command_line_exception_handler.php on line 6 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46305&edit=1
