xref: /PHP-7.0/Zend/tests/bug73338.phpt (revision 8b177f6a)
1--TEST--
2Bug #73338: Ensure exceptions in function init opcodes are cleaned properly
3--FILE--
4<?php
5
6try { call_user_func(new class { function __destruct () { throw new Error; } }); } catch (Error $e) {}
7
8set_error_handler(function() { throw new Error; });
9
10try { var_dump(new stdClass, call_user_func("fail")); } catch (Error $e) {}
11
12try { (function() { call_user_func("fail"); })(); } catch (Error $e) {}
13
14try { [new class { static function foo() {} function __destruct () { throw new Error; } }, "foo"](); } catch (Error $e) {}
15
16?>
17--EXPECTF--
18Warning: call_user_func() expects parameter 1 to be a valid callback, no array or string given in %s on line %d
19