3v4l.org

run code in 300+ PHP versions simultaneously
<?php function v(){ $x = 5; return function () use ($x){ echo $x; }; } $func = v(); $func();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gRILJ
function name:  (null)
number of ops:  6
compiled vars:  !0 = $func
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'v'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   13     3        INIT_DYNAMIC_CALL                                        !0
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Function v:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gRILJ
function name:  v
number of ops:  5
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, 5
    7     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FgRILJ%3A7%240'
          2        BIND_LEXICAL                                             ~2, !0
    9     3      > RETURN                                                   ~2
   10     4*     > RETURN                                                   null

End of function v

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

End of function %00%7Bclosure%7D%2Fin%2FgRILJ%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.26 ms | 1397 KiB | 14 Q