3v4l.org

run code in 300+ PHP versions simultaneously
<?php function callFunc1(Closure $closure) { $closure(); } function callFunc2(Callable $callback) { $callback(); } $function = function() { echo 'Hello, World!'; }; callFunc1($function); // Hello, World! callFunc2($function); // Hello, World!
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kqeYD
function name:  (null)
number of ops:  9
compiled vars:  !0 = $function
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FkqeYD%3A11%240'
          1        ASSIGN                                                   !0, ~1
   15     2        INIT_FCALL                                               'callfunc1'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0          
   16     5        INIT_FCALL                                               'callfunc2'
          6        SEND_VAR                                                 !0
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

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

End of function callfunc1

Function callfunc2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kqeYD
function name:  callFunc2
number of ops:  4
compiled vars:  !0 = $callback
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0          
    9     3      > RETURN                                                   null

End of function callfunc2

Function %00%7Bclosure%7D%2Fin%2FkqeYD%3A11%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kqeYD
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ECHO                                                     'Hello%2C+World%21'
   13     1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FkqeYD%3A11%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152 ms | 1399 KiB | 15 Q