ID:               21236
 User updated by:  [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Feedback
+Status:           Open
 Bug Type:         Scripting Engine problem
 Operating System: Linux
 PHP Version:      4.3.0
 New Comment:

Ok... you need 2 files.

--------------file1.php-----------------------
<?php
require 'file2.php';

function f2($param) {
        f3($param);
}

function f1($param) {
        f2($param);
}

f1('foo');
?>
----------end file1.php---------------

----------file2.php---------------
<?php

function f3($param) {
        echo '<table border="1">';

        $backtrace = debug_backtrace();

        foreach ( $backtrace as $frame ) {
                echo
"<tr><td>$frame[file]</td><td>$frame[line]</td><td>$frame[function]</td><td>";
                print_r($frame['args']);
                echo "</td></tr>\n";
        }

        echo '</table>';
}
?>
-------------end file2.php---------------

On my server (apache2, php4.3) I get:
/home/julian/public_html/file1.php 5 f3 Array ( [0] => foo )  
/home/julian/public_html/file1.php 9 f2  
/home/julian/public_html/file1.php 12 f1  

But on my friend's server (apache1.3, php4.3) - though there are surely
plenty of other differences as well - I get:
/web/sites/Julian/docs/file1.php 5 f3 Array ( [0] => foo )  
/web/sites/Julian/docs/file1.php 9 f2 Array ( [0] => foo )  
/web/sites/Julian/docs/file1.php 12 f1 Array ( [0] => foo )


Previous Comments:
------------------------------------------------------------------------

[2003-01-20 21:02:27] [EMAIL PROTECTED]

Please add a short example script which shows the problem
clearly.


------------------------------------------------------------------------

[2003-01-20 18:31:47] [EMAIL PROTECTED]

A friend tried this and doesn't seem to see the problem.  The main
difference is that he is testing with Apache 1.3 whereas I was testing
with Apache 2... perhaps that is the key somehow?  I will try to test
it myself when I have time but I thought it might click for someone so
I'm noting it now.

------------------------------------------------------------------------

[2002-12-28 03:00:17] [EMAIL PROTECTED]

when you get the stack trace from debug_backtrace(), alal the frames
for calls to functions within a file have no function arguments
listed.

If you move a function into another file and call it, then its
arguments will be listed.

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=21236&edit=1

Reply via email to