Arquivos
hhvm/hphp/test/quick/exceptions5.php
T
ptarjan 503f75d08b Rename test directories
These names don't make sense now that we run both suites the same
way.
2013-04-17 09:06:51 -07:00

33 linhas
648 B
PHP

<?php
function g($obj) {
echo "g\n";
$obj->yar(123);
}
class D {
public function yar($y) {
$x = $y;
}
// C++ exceptions, like stack overflow, now prevent further php code from
// running. So this destructor should not run.
public function __destruct() {
g($this);
}
}
class C {
public function baz($z) {
return $z = call_user_func(array($this,'foo'), $z);
}
public function bar($z) {
return $z = call_user_func(array($this,'baz'), $z);
}
public function foo($z) {
$guard = new D;
return $z = call_user_func(array($this,'bar'), $z);
}
}
function bar() {
$obj = new C;
$obj->foo(123);
}
bar();