3v4l.org

run code in 300+ PHP versions simultaneously
<?php $func = function($a) { return $a + 2; }; $func = function($a) use($func) { return $func() * 2; }; var_dump( $func(2) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vaC15
function name:  (null)
number of ops:  12
compiled vars:  !0 = $func
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FvaC15%3A3%240'
          1        ASSIGN                                                   !0, ~1
    7     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FvaC15%3A7%241'
          3        BIND_LEXICAL                                             ~3, !0
          4        ASSIGN                                                   !0, ~3
   11     5        INIT_FCALL                                               'var_dump'
          6        INIT_DYNAMIC_CALL                                        !0
          7        SEND_VAL_EX                                              2
          8        DO_FCALL                                      0  $5      
          9        SEND_VAR                                                 $5
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FvaC15%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vaC15
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ADD                                              ~1      !0, 2
          2      > RETURN                                                   ~1
    5     3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FvaC15%3A3%240

Function %00%7Bclosure%7D%2Fin%2FvaC15%3A7%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vaC15
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $a, !1 = $func
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
    8     2        INIT_DYNAMIC_CALL                                        !1
          3        DO_FCALL                                      0  $2      
          4        MUL                                              ~3      $2, 2
          5      > RETURN                                                   ~3
    9     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FvaC15%3A7%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.61 ms | 1396 KiB | 15 Q