Arquivos
hhvm/hphp/test/ext/debugger_tests/stack_t.php
T
Paul Tarjan f5569e4755 clean up tests dir
I think this dir shouldn't have anything non-necessary in the root.
2013-06-06 16:31:09 -07:00

44 linhas
790 B
PHP

<?php
// Wanring: line numbers are sensitive, do not change
function bar($x, $y) {
$obj = new cls();
error_log("bar:".$x." ".$y);
if ($y <= 0) {
return $x;
}
$obj->pub($x, $y - 1);
}
function foo($x, $y) {
error_log("foo:".$x." ".$y);
return bar($x, $y);
}
class cls {
public function pub($x, $y) {
error_log("in pub:".$x." ".$y);
$v = $this->pri($x, $y);
error_log("out pub:".$x." ".$y);
return $v;
}
private function pri($x, $y) {
error_log("in pri:".$x." ".$y);
foo($x, $y);
if ($x == 3) {
hphpd_break();
}
error_log("out pri:".$x." ".$y);
}
}
function test($x, $y) {
error_log("test ".$x." ".$y);
$obj = new cls();
$obj->pub($x, $y);
error_log("test done ".$x." ".$y);
}
error_log('stack_t.php loaded');