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: krakjoe@php.net Assigned:
Status: Closed Package: *General Issues
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2021-05-24 05:25 UTC] krakjoe@php.net
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] krakjoe@php.net
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] git@php.net
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] git@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 13:01:29 2024 UTC