3v4l.org

run code in 300+ PHP versions simultaneously
<?php function func($param, $block) { echo $block($param); } $another_func = function() { $block = function($param) { echo $param; }; func("Hello", $block); }; $another_func(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cQR8J
function name:  (null)
number of ops:  5
compiled vars:  !0 = $another_func
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FcQR8J%3A8%240'
          1        ASSIGN                                                   !0, ~1
   18     2        INIT_DYNAMIC_CALL                                        !0
          3        DO_FCALL                                      0          
   20     4      > RETURN                                                   1

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

End of function func

Function %00%7Bclosure%7D%2Fin%2FcQR8J%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cQR8J
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $block
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FcQR8J%3A10%241'
          1        ASSIGN                                                   !0, ~1
   15     2        INIT_FCALL                                               'func'
          3        SEND_VAL                                                 'Hello'
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0          
   16     6      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FcQR8J%3A8%240

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

End of function %00%7Bclosure%7D%2Fin%2FcQR8J%3A10%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.79 ms | 1399 KiB | 14 Q