File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests / bug61767.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Jul 22 01:32:17 2013 UTC (11 years, 8 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17, HEAD
5.4.17

    1: --TEST--
    2: Bug #61767 (Shutdown functions not called in certain error situation)
    3: --FILE--
    4: <?php
    5: set_error_handler(function($code, $msg, $file = null, $line = null) {
    6:     echo "Error handler called ($msg)\n";
    7:     throw new \ErrorException($msg, $code, 0, $file, $line);
    8: });
    9: 
   10: register_shutdown_function(function(){
   11:     echo "Shutting down\n";
   12:     print_r(error_get_last());
   13: });
   14: 
   15: //$undefined = null; // defined variable does not cause problems
   16: $undefined->foo();
   17: --EXPECTF--
   18: Error handler called (Undefined variable: undefined)
   19: 
   20: Warning: Uncaught exception 'ErrorException' with message 'Undefined variable: undefined' in %sbug61767.php:13
   21: Stack trace:
   22: #0 %sbug61767.php(13): {closure}(8, 'Undefined varia...', '%s', 13, Array)
   23: #1 {main}
   24:   thrown in %sbug61767.php on line 13
   25: 
   26: Fatal error: Call to a member function foo() on a non-object in %sbug61767.php on line 13
   27: Shutting down
   28: Array
   29: (
   30:     [type] => 1
   31:     [message] => Call to a member function foo() on a non-object
   32:     [file] => %sbug61767.php
   33:     [line] => 13
   34: )

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>