Arquivos
hhvm/hphp/test/quick/debug_backtrace.php
T
mwilliams 6f223125a5 Prevent more optimizations in repo mode
"$unused_local = UndefinedConstant;" was being optimized away, so
we didnt get a warning for the constant. return it instead.

  $unused_local = new Object;
  return;

became

  new Object;
  return;

This affected the (unspecified) order of destruction of $this
vs $unused_local. Since we're specifically trying to test that
we dont crash when a local generates a backtrace after $this
has been destroyed, force the variable to be used.
2013-04-19 12:21:56 -07:00

35 linhas
580 B
PHP

<?php
class A {
static function foo() {
var_dump(debug_backtrace());
}
function bar($a, $b, $c = null) {
$this->foo();
}
}
function bar() {
$a = new A();
$a->bar(1, "str", array(1, 2, 3));
hphp_invoke_method($a, "A", "bar", array(1, 2));
}
function foo() {
call_user_func("bar");
}
function error_handler($errno, $errstr, $errfile, $errline, $errcontext, $extra) {
// Make sure this function shows up in a backtrace
var_dump(debug_backtrace());
}
function main() {
foo();
set_error_handler('error_handler');
return FakeConstant;
}
main();