3v4l.org

run code in 300+ PHP versions simultaneously
<?php $f = function($s) { echo $s*2; }; $f(4); echo "\n"; $g = function($a,$h) { echo ($a + $h(4)); }; $g(5,$f);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OmnMb
function name:  (null)
number of ops:  13
compiled vars:  !0 = $f, !1 = $g
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FOmnMb%3A3%240'
          1        ASSIGN                                                   !0, ~2
    5     2        INIT_DYNAMIC_CALL                                        !0
          3        SEND_VAL_EX                                              4
          4        DO_FCALL                                      0          
    7     5        ECHO                                                     '%0A'
    9     6        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FOmnMb%3A9%241'
          7        ASSIGN                                                   !1, ~5
   11     8        INIT_DYNAMIC_CALL                                        !1
          9        SEND_VAL_EX                                              5
         10        SEND_VAR_EX                                              !0
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

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

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

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

End of function %00%7Bclosure%7D%2Fin%2FOmnMb%3A9%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.59 ms | 1395 KiB | 13 Q