3v4l.org

run code in 300+ PHP versions simultaneously
<?php function doWeirdStuff($fn1, $fn2, $val) { return $fn2($fn1($val)); } echo doWeirdStuff( function ($val) { return ++$val; }, function ($val) { return $val *= 2; }, 3 );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b1VdQ
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'doweirdstuff'
    8     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fb1VdQ%3A8%240'
          2        SEND_VAL                                                 ~0
    9     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fb1VdQ%3A9%241'
          4        SEND_VAL                                                 ~1
   10     5        SEND_VAL                                                 3
          6        DO_FCALL                                      0  $2      
          7        ECHO                                                     $2
   11     8      > RETURN                                                   1

Function doweirdstuff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b1VdQ
function name:  doWeirdStuff
number of ops:  11
compiled vars:  !0 = $fn1, !1 = $fn2, !2 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    4     3        INIT_DYNAMIC_CALL                                        !1
          4        INIT_DYNAMIC_CALL                                        !0
          5        SEND_VAR_EX                                              !2
          6        DO_FCALL                                      0  $3      
          7        SEND_VAR_NO_REF_EX                                       $3
          8        DO_FCALL                                      0  $4      
          9      > RETURN                                                   $4
    5    10*     > RETURN                                                   null

End of function doweirdstuff

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

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

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

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.2 ms | 1399 KiB | 14 Q