3v4l.org

run code in 300+ 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                                  '%00%7Bclosure%7D%2Fin%2FmHcBC%3A8%240'
   11     2        SEND_VAL                                                 ~0
          3        DO_FCALL                                      0          
   34     4      > RETURN                                                   1

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

Function %00%7Bclosure%7D%2Fin%2FmHcBC%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mHcBC
function name:  {closure}
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 function %00%7Bclosure%7D%2Fin%2FmHcBC%3A8%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.22 ms | 1398 KiB | 14 Q