3v4l.org

run code in 300+ PHP versions simultaneously
<?php $count = 0; $counter1 = function () use ($count) { echo $count; }; $counter2 = function () { echo $count; }; $counter1(); $count = 1; $counter1(); $count = 2; $counter2();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ti7Qa
function name:  (null)
number of ops:  15
compiled vars:  !0 = $count, !1 = $counter1, !2 = $counter2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 0
    5     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fti7Qa%3A5%240'
          2        BIND_LEXICAL                                             ~4, !0
          3        ASSIGN                                                   !1, ~4
    9     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fti7Qa%3A9%241'
          5        ASSIGN                                                   !2, ~6
   13     6        INIT_DYNAMIC_CALL                                        !1
          7        DO_FCALL                                      0          
   15     8        ASSIGN                                                   !0, 1
   17     9        INIT_DYNAMIC_CALL                                        !1
         10        DO_FCALL                                      0          
   19    11        ASSIGN                                                   !0, 2
   21    12        INIT_DYNAMIC_CALL                                        !2
         13        DO_FCALL                                      0          
         14      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fti7Qa%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ti7Qa
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   BIND_STATIC                                              !0
    6     1        ECHO                                                     !0
    7     2      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fti7Qa%3A5%240

Function %00%7Bclosure%7D%2Fin%2Fti7Qa%3A9%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ti7Qa
function name:  {closure}
number of ops:  2
compiled vars:  !0 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ECHO                                                     !0
   11     1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fti7Qa%3A9%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.4 ms | 1394 KiB | 13 Q