From:             artaxerxes2 at iname dot com
Operating system: Fedora 14
PHP version:      Irrelevant
Package:          Unknown/Other Function
Bug Type:         Bug
Bug description:set_exception_handler fails to register in Interactive Shell

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
%s\n",$exception->getMessage ()) ;} set_exception_handler ("ff") ; throw
new 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 bug report at https://bugs.php.net/bug.php?id=63225&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=63225&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=63225&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=63225&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=63225&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=63225&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=63225&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=63225&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=63225&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=63225&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=63225&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=63225&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=63225&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=63225&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63225&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=63225&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=63225&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=63225&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63225&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=63225&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63225&r=mysqlcfg

Reply via email to