php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78842 Throwable ->getTrace() no longer returns "args"
Submitted: 2019-11-20 11:26 UTC Modified: 2019-11-20 11:49 UTC
From: alex dot tartan at gmail dot com Assigned: cmb (profile)
Status: Not a bug Package: *General Issues
PHP Version: 7.4.0RC6 OS: Ubuntu 18.04
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: alex dot tartan at gmail dot com
New email:
PHP Version: OS:

 

 [2019-11-20 11:26 UTC] alex dot tartan at gmail dot com
Description:
------------
Hello, 

I've ran into an issue while testing out 7.4.0~rc6

The 7.3 version "properly" returns the "args" key in the getTrace() items.

Is this "non-args" behavior intended? 

I saw that `debug_backtrace` has a `DEBUG_BACKTRACE_IGNORE_ARGS` option to improve performance. 
Was this adopted by `getTrace()` as default?

Test script:
---------------
$x = new Exception();
var_dump($x->getTrace()[0]['args'] ?? []);
var_dump(debug_backtrace()[0]['args']);

Expected result:
----------------
The "args" key should be present in the trace items:

/code/test/Common/Service/Logger/Formatter/ExceptionFormatterTest.php:23:
array(2) {
  [0] =>
  string(5) "param"
  [1] =>
  array(1) {
    'paramKey' =>
    int(1)
  }
}
/code/test/Common/Service/Logger/Formatter/ExceptionFormatterTest.php:24:
array(2) {
  [0] =>
  string(5) "param"
  [1] =>
  array(1) {
    'paramKey' =>
    int(1)
  }
}

Actual result:
--------------
/code/test/Common/Service/Logger/Formatter/ExceptionFormatterTest.php:23:
array(0) {
}
/code/test/Common/Service/Logger/Formatter/ExceptionFormatterTest.php:24:
array(2) {
  [0] =>
  string(5) "param"
  [1] =>
  array(1) {
    'paramKey' =>
    int(1)
  }
}


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-11-20 11:49 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2019-11-20 11:49 UTC] cmb@php.net
You have to disable zend.exception_ignore_args to see these
arguments[1].

[1] <https://www.php.net/manual/en/migration74.other-changes.php#migration74.other-changes.ini>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 00:01:30 2024 UTC