From:             gk at proliberty dot com
Operating system: linux ; kernel 2.4.18
PHP version:      4.3.2
PHP Bug Type:     Unknown/Other Function
Bug description:  debug_backtrace() fails to report __FILE__, __LINE__

Description:
------------
debug_backtrace() should behave consistently in order to be useful in all
contexts: inside classes, functions and from top level of script file.

However, when exectuted from top level, it returns an empty array.

According to the documentation, it should return an array with minimal
info including __LINE__, __FILE__
>debug_backtrace() generates a PHP backtrace and returns this information
as an associative array. The possible returned elements are listed in the
following table: 
...
line integer The current line number. See also __LINE__.  
file string The current file name. See also __FILE__.  



Reproduce code:
---------------
<?php print_r(debug_backtrace()); ?>

Expected result:
----------------
[EMAIL PROTECTED] xobj]$ php /tmp/a.php
array(1) {
    [0]=>
    array(4) {
        ["file"] => string(10) "/tmp/a.php"
        ["line"] => int(1)
        ["function"] =>
        ["args"]=>
    }
}



Actual result:
--------------
[EMAIL PROTECTED] xobj]$ php /tmp/a.php
Array
(
)


-- 
Edit bug report at http://bugs.php.net/?id=24214&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=24214&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=24214&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=24214&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=24214&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=24214&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=24214&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=24214&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=24214&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=24214&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=24214&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24214&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=24214&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=24214&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=24214&r=gnused

Reply via email to