php-src/Zend/tests/bug69212.phpt

44 lines
712 B
Plaintext
Raw Normal View History

2015-03-11 01:17:56 +08:00
--TEST--
Bug #69212: Leaking VIA_HANDLER func when exception thrown in __call/... arg passing
--FILE--
<?php
class Test {
public static function __callStatic($method, $args) {}
public function __call($method, $args) {}
}
function do_throw() { throw new Exception; }
try {
Test::foo(do_throw());
} catch (Exception $e) {
echo "Caught!\n";
}
try {
(new Test)->bar(do_throw());
} catch (Exception $e) {
echo "Caught!\n";
}
2015-03-11 08:19:34 +08:00
try {
$f = function () {};
$f->__invoke(do_throw());
} catch (Exception $e) {
echo "Caught!\n";
}
try {
$t = new Test;
$f->__invoke($t->bar(Test::foo(do_throw())));
} catch (Exception $e) {
echo "Caught!\n";
}
2015-03-11 01:17:56 +08:00
?>
--EXPECT--
Caught!
Caught!
2015-03-11 08:19:34 +08:00
Caught!
Caught!