mirror of
https://github.com/php/php-src.git
synced 2024-09-23 19:07:26 +00:00
53 lines
728 B
Plaintext
53 lines
728 B
Plaintext
|
--TEST--
|
||
|
Exceptions thrown into a rope must not leak
|
||
|
--FILE--
|
||
|
<?php
|
||
|
|
||
|
class Obj {
|
||
|
function __get($x) {
|
||
|
throw new Exception();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
try {
|
||
|
$x = new Obj;
|
||
|
$y = 0;
|
||
|
$r = "$y|$x->x|";
|
||
|
echo "should never be reached";
|
||
|
} catch (Exception $e) {
|
||
|
echo "$e\n";
|
||
|
}
|
||
|
|
||
|
try {
|
||
|
$x = new Obj;
|
||
|
$y = 0;
|
||
|
$r = "$y$x->x|";
|
||
|
echo "should never be reached";
|
||
|
} catch (Exception $e) {
|
||
|
echo "$e\n";
|
||
|
}
|
||
|
|
||
|
try {
|
||
|
$x = new Obj;
|
||
|
$y = 0;
|
||
|
$r = "$y|$y$x->x";
|
||
|
echo "should never be reached";
|
||
|
} catch (Exception $e) {
|
||
|
echo "$e\n";
|
||
|
}
|
||
|
|
||
|
?>
|
||
|
--EXPECTF--
|
||
|
Exception in %s:%d
|
||
|
Stack trace:
|
||
|
#0 %s(%d): Obj->__get('x')
|
||
|
#1 {main}
|
||
|
Exception in %s:%d
|
||
|
Stack trace:
|
||
|
#0 %s(%d): Obj->__get('x')
|
||
|
#1 {main}
|
||
|
Exception in %s:%d
|
||
|
Stack trace:
|
||
|
#0 %s(%d): Obj->__get('x')
|
||
|
#1 {main}
|