|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2016-08-07 16:57 UTC] cmb@php.net
 
-Assigned To:
+Assigned To: cmb
  [2016-08-07 16:57 UTC] cmb@php.net
  [2016-08-07 17:19 UTC] cmb@php.net
 
-Summary: Exception backtrace produces wrong integer values
          when passed by reference
+Summary: Exception backtrace produces unexpected values
  [2016-08-07 17:19 UTC] cmb@php.net
  [2016-08-07 17:20 UTC] cmb@php.net
 
-Status: Assigned
+Status: Closed
  [2016-08-07 17:20 UTC] cmb@php.net
  [2020-02-07 06:06 UTC] phpdocbot@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 20:00:01 2025 UTC | 
Description: ------------ Exception backtrace produces wrong integer values when passed by reference - a regression VS PHP 5.x, as can be seen in the test script. Test script: --------------- <pre><?php function recurse_bug($count) { if ($count) { return recurse_bug(--$count); // if we use instead $count - 1, then BT will be prodcued OK on PHP 7 too } $e = new Exception(); print $e->getTraceAsString(); } recurse_bug(2); /* On PHP 5.x we will get the correct BT: #0 /var/www/html/frontend/scrap.php(4): recurse_bug(0) #1 /var/www/html/frontend/scrap.php(4): recurse_bug(1) #2 /var/www/html/frontend/scrap.php(9): recurse_bug(2) #3 {main} On PHP 7.x we will get the following wrong BT: #0 /var/www/html/frontend/scrap.php(4): recurse_bug(0) #1 /var/www/html/frontend/scrap.php(4): recurse_bug(0) #2 /var/www/html/frontend/scrap.php(9): recurse_bug(1) #3 {main} */ Expected result: ---------------- #0 /var/www/html/frontend/scrap.php(4): recurse_bug(0) #1 /var/www/html/frontend/scrap.php(4): recurse_bug(1) #2 /var/www/html/frontend/scrap.php(9): recurse_bug(2) #3 {main} Actual result: -------------- #0 /var/www/html/frontend/scrap.php(4): recurse_bug(0) #1 /var/www/html/frontend/scrap.php(4): recurse_bug(0) #2 /var/www/html/frontend/scrap.php(9): recurse_bug(1) #3 {main} */