Bug #81076 [PATCH]: Implicit use causes incorrect count in debug info of closures

From: Date: Mon, 24 May 2021 05:45:29 +0000
Subject: Bug #81076 [PATCH]: Implicit use causes incorrect count in debug info of closures
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-234002@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81076&edit=1

 ID:                 81076
 Patch added by:     krakjoe@php.net
 Reported by:        krakjoe@php.net
 Summary:            Implicit use causes incorrect count in debug info of
                     closures
 Status:             Open
 Type:               Bug
 Package:            *General Issues
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

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


Previous Comments:
------------------------------------------------------------------------
[2021-05-24 05:25:00] 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) {
  }
}


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=81076&edit=1


Thread (3 messages)

« previous php.bugs (#234002) next »