note 38938 deleted from function.debug-backtrace by nlopess
| From: | nlopess@php.net | Date: | Tue, 13 Jan 2004 14:49:34 +0000 |
| Subject: | note 38938 deleted from function.debug-backtrace by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-63429@lists.php.net to get a copy of this message | ||
Note Submitter: Vitch
----
Not sure if this is expected behaviour but the "args" portion of the returned array is not
present if you call your function as an argument to another function.
i.e.
<?php
function test($in){
return($in);
}
function test2($in){
print_r(debug_backtrace());
return($in);
}
test(test2(6));
?>
As you can see, the args array doesn't show up in the output of debug_backtrace (PHP 4.3.4). I
noticed this when trying to debug a function I was using to set a constant i.e.
<?php
define("MY_CONSTANT", myFunc(1, 2, 3, 4));
?>
Which I guess is fairly normal thing to do... The workaround is to assign the return value of your
function to a temp variable and use this variable in the second function call i.e.
<?php
$tmp = myFunc(1, 2, 3, 4);
define("MY_CONSTANT", $tmp);
?>