php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78132 PHP 7.4 and later don't associate right line number with BIND_STATIC
Submitted: 2019-06-08 16:54 UTC Modified: -
From: derick@php.net Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: master-Git-2019-06-08 (Git) OS: *
Private report: No CVE-ID: None
 [2019-06-08 16:54 UTC] derick@php.net
Description:
------------
With PHP 7.3, the BIND_STATIC lines are recorded on the right location, with PHP 7.4 they are no longer. This is with OPcache turned off:

$ php -dopcache.enable_cli=0 -dvld.active=1 /tmp/bind-bug.php


Test script:
---------------
<?php
$someObject->reduce(function () use (
    $outerItem,
    $anotherOuterItem
) {
   return false;
});


Expected result:
----------------
With PHP 7.3:

filename:       /tmp/bind-bug.php
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $outerItem, !1 = $anotherOuterItem
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   EXT_NOP                                                  
   3     1        BIND_STATIC                                              !0, 'outerItem'
   4     2        BIND_STATIC                                              !1, 'anotherOuterItem'
   6     3        EXT_STMT                                                 
         4      > RETURN                                                   <false>
   7     5*       EXT_STMT                                                 
         6*     > RETURN                                                   null


Actual result:
--------------
With PHP 7.4:

filename:       /tmp/bind-bug.php
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $outerItem, !1 = $anotherOuterItem
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   EXT_NOP                                                  
         1        BIND_STATIC                                              !0
         2        BIND_STATIC                                              !1
   6     3        EXT_STMT                                                 
         4      > RETURN                                                   <false>
   7     5*       EXT_STMT                                                 
         6*     > RETURN                                                   null


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-06-08 19:48 UTC] krakjoe@php.net
Automatic comment on behalf of krakjoe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=006b1911268fca9e6fa9243c2296d614f46e2ccc
Log: Fix #78132 wrong line number on ZEND_BIND_STATIC for lexical vars
 [2019-06-08 19:48 UTC] krakjoe@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Jan 21 02:01:23 2021 UTC