global statement removal: hphp/test [7/x]
[hiphop-php.git] / hphp / test / quick / debug_backtrace.php
blob07918b835b77694218e7d7b16805ed3bbca829a4
1 <?hh /* uses RenameFunction to ensure that all arguments are retained */
3 class A {
4 static function foo() {
5 var_dump(debug_backtrace());
8 function bar($a, $b, $c = null) {
9 $this->foo();
13 function bar() {
14 $a = new A();
15 $a->bar(1, "str", array(1, 2, 3));
16 hphp_invoke_method($a, "A", "bar", array(1, 2));
17 hphp_invoke_method($a, "A", "bar", Map {'a' => 1, 'b' => 2});
19 function foo() {
20 call_user_func("bar");
23 function error_handler($errno, $errstr, $errfile, $errline, $errcontext) {
24 // Make sure this function shows up in a backtrace
25 var_dump(debug_backtrace());
28 function main() {
29 foo();
31 set_error_handler('error_handler');
33 main();