note 68850 added to function.debug-backtrace
| From: | admin at sgssweb dot com | Date: | Sun, 13 Aug 2006 09:30:06 +0000 |
| Subject: | note 68850 added to function.debug-backtrace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-115853@lists.php.net to get a copy of this message | ||
Surprizingly, debug_backtrace() cannot aquire arguments from the function that is used as the second
or later argument of a function.
<?php
function a($p) {
$backtrace = debug_backtrace();
if (isset($backtrace[0]['args']))
var_export($backtrace[0]['args']);
else
echo "Cannot aquire arguments";
echo "<br />";
return $p;
}
function b($p1, $p2, $p3) {
echo "$p1, $p2, $p3";
}
// This outputs:
// array ( 0 => 'First a', )
// Cannot aquire arguments
// Cannot aquire arguments
// First a, Second a, Third a
b(a("First a"), a("Second a"), a("Third a"));
?>
----
Server IP: 210.138.109.182
Probable Submitter: 210.20.184.116
----
X-Spam-Status: No, hits=3.3 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER,
HTML_MESSAGE autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.debug-backtrace.php
Edit -- https://master.php.net/note/edit/68850
Del: integrated -- https://master.php.net/note/delete/68850/integrated
Del: useless -- https://master.php.net/note/delete/68850/useless
Del: bad code -- https://master.php.net/note/delete/68850/bad+code
Del: spam -- https://master.php.net/note/delete/68850/spam
Del: non-english -- https://master.php.net/note/delete/68850/non-english
Del: in docs -- https://master.php.net/note/delete/68850/in+docs
Del: other reasons-- https://master.php.net/note/delete/68850
Reject -- https://master.php.net/note/reject/68850
Search -- https://master.php.net/manage/user-notes.php