3v4l.org

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

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

End of function v

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

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.35 ms | 1397 KiB | 14 Q