From:             the...@php.net
Operating system: Windows
PHP version:      5.2.8
PHP Bug Type:     Scripting Engine problem
Bug description:  Args disappear from stack trace

Description:
------------
Exception's stacktraces miss the "args" key in certain situations (whereas
debug_backtrace() will report them).

Reproduce code:
---------------
php -r 'class Chained extends Exception { function __construct($message,
$cause) { parent::__construct($message); $this->cause= $cause; }} function
raise($message, $cause) { throw new Chained($message, new
Exception($cause)); } try { raise("Arg", "Cause"); } catch (Exception $e) {
var_dump($e->getTrace(), $e->cause->getTrace()); }'

Expected result:
----------------
Twice this:

array(1) {
  [0]=>
  array(4) {
    ["file"]=>
    string(17) "Command line code"
    ["line"]=>
    int(1)
    ["function"]=>
    string(5) "raise"
    ["args"]=>
    array(2) {
      [0]=>
      &string(3) "Arg"
      [1]=>
      &string(5) "Cause"
    }
  }
}


Actual result:
--------------
array(1) {
  [0]=>
  array(4) {
    ["file"]=>
    string(17) "Command line code"
    ["line"]=>
    int(1)
    ["function"]=>
    string(5) "raise"
    ["args"]=>
    array(2) {
      [0]=>
      string(3) "Arg"
      [1]=>
      string(5) "Cause"
    }
  }
}
array(1) {
  [0]=>
  array(3) {
    ["file"]=>
    string(17) "Command line code"
    ["line"]=>
    int(1)
    ["function"]=>
    string(5) "raise"
  }
}

The second array is missing the "args" key. In PHP 5.3, it's present.

-- 
Edit bug report at http://bugs.php.net/?id=47284&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=47284&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=47284&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=47284&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=47284&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=47284&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=47284&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=47284&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=47284&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=47284&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=47284&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=47284&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=47284&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=47284&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=47284&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=47284&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=47284&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=47284&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=47284&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=47284&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=47284&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=47284&r=mysqlcfg

Reply via email to