Thanks to visit codestin.com
Credit goes to bugs.php.net

php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81076 Implicit use causes incorrect count in debug info of closures
Submitted: 2021-05-24 05:25 UTC Modified: -
From: [email protected] Assigned:
Status: Closed Package: *General Issues
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2021-05-24 05:25 UTC] [email protected]
Description:
------------
Implicit invalid uses cause incorrect count in debug info of Closures static variables

Test script:
---------------
<?php
var_dump(fn() => [$why, $do, $we, $count]);
?>

Expected result:
----------------
object(Closure)#1 (1) {
  ["static"]=>
  array(0) {
  }
}

Actual result:
--------------
object(Closure)#1 (1) {
  ["static"]=>
  array(4) {
  }
}

Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-05-24 05:45 UTC] [email protected]
The following pull request has been associated:

Patch Name: Fix #81076
On GitHub:  https://github.com/php/php-src/pull/7038
Patch:      https://github.com/php/php-src/pull/7038.patch
 [2021-05-25 09:27 UTC] [email protected]
Automatic comment on behalf of krakjoe
Revision: https://github.com/php/php-src/commit/213063f6ca0780ea5adf07467a826b348f29b79a
Log: Fix #81076 Invalid implicit binds cause incorrect count in static vars of closure debug info
 [2021-05-25 09:27 UTC] [email protected]
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Oct 21 15:00:01 2025 UTC