3v4l.org

run code in 500+ PHP versions simultaneously
<?php function foo( $xfunc ) { $n = 2; return $xfunc( $n ); } foo( function( $num ) { $num = $num * 2; return $num; }); //
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mHcBC
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                                   'foo'
          1        DECLARE_LAMBDA_FUNCTION                              ~0      [0]
   11     2        SEND_VAL                                                     ~0
    8     3        DO_FCALL                                          0          
   34     4      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mHcBC
function name:  {closure:/in/mHcBC:8}
number of ops:  5
compiled vars:  !0 = $num
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   RECV                                                 !0      
    9     1        MUL                                                  ~1      !0, 2
          2        ASSIGN                                                       !0, ~1
   10     3      > RETURN                                                       !0
   11     4*     > RETURN                                                       null

End of Dynamic Function 0

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mHcBC
function name:  foo
number of ops:  7
compiled vars:  !0 = $xfunc, !1 = $n
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    4     1        ASSIGN                                                       !1, 2
    5     2        INIT_DYNAMIC_CALL                                            !0
          3        SEND_VAR_EX                                                  !1
          4        DO_FCALL                                          0  $3      
          5      > RETURN                                                       $3
    6     6*     > RETURN                                                       null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.83 ms | 1973 KiB | 14 Q