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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
12 + 7 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

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: Fri Mar 29 09:01:28 2024 UTC