Bug #63225 [Opn->Dup]: set_exception_handler fails to register in Interactive Shell

From: Date: Mon, 08 Oct 2012 03:22:14 +0000
Subject: Bug #63225 [Opn->Dup]: set_exception_handler fails to register in Interactive Shell
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-173927@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=63225&edit=1 ID: 63225 Updated by: laruence@php.net Reported by: artaxerxes2 at iname dot com Summary: set_exception_handler fails to register in Interactive Shell -Status: Open +Status: Duplicate Type: Bug Package: Unknown/Other Function Operating System: Fedora 14 PHP Version: Irrelevant Block user comment: N Private report: N New Comment: dup to #62985 Previous Comments: ------------------------------------------------------------------------ [2012-10-05 16:02:29] artaxerxes2 at iname dot com Description: ------------ Following the code from http://www.php.net/manual/en/function.set-error-handler.php#109149 I ran it on the Interactive Shell instead of a script. The captureNormal method worked, the captureShutdown worked, but the captureException did not. Yet, the set_exception_handler registered it, just didn't call it. I run PHP 5.3.8, but cannot test with newer PHP. I read the bug reports and the Changelog and didn't see any mention, so I figure it's a new bug. Test script: --------------- From command line: $ echo '<?php function ff($exception){ printf ("I am a handler, got %s\n",$exception->getMessage ()) ;} set_exception_handler ("ff") ; throw new Exception ("blabla") ; echo "This is bad\n" ;' | php From Interactive Shell (php -a): php> function ff ($exception) { printf ("I am a handler, got php> %s\n",$exception->getMessage ()) ;} set_exception_handler ("ff") ; throw new php> Exception ("blabla") ; Expected result: ---------------- I am a handler, got blabla Actual result: -------------- PHP Warning: Uncaught exception 'Exception' with message 'blabla' in php shell code:1 Stack trace: #0 {main} thrown in php shell code on line 1 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=63225&edit=1

« previous php.bugs (#173927) next »