3v4l.org

run code in 300+ PHP versions simultaneously
<?php $count = 0; $counter1 = function () use ($count) { echo $count; }; $counter2 = function () use ($count) { 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/5APpL
function name:  (null)
number of ops:  16
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%2F5APpL%3A5%240'
          2        BIND_LEXICAL                                             ~4, !0
          3        ASSIGN                                                   !1, ~4
    9     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F5APpL%3A9%241'
          5        BIND_LEXICAL                                             ~6, !0
          6        ASSIGN                                                   !2, ~6
   13     7        INIT_DYNAMIC_CALL                                        !1
          8        DO_FCALL                                      0          
   15     9        ASSIGN                                                   !0, 1
   17    10        INIT_DYNAMIC_CALL                                        !1
         11        DO_FCALL                                      0          
   19    12        ASSIGN                                                   !0, 2
   21    13        INIT_DYNAMIC_CALL                                        !2
         14        DO_FCALL                                      0          
         15      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F5APpL%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5APpL
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%2F5APpL%3A5%240

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

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.58 ms | 1395 KiB | 13 Q