3v4l.org

run code in 300+ PHP versions simultaneously
<?php function reduce(int $a, int $b, callback $reducer) : int { return $reducer($a, $b); } reduce(1, 2, function($a, $b, $c){ return $a + $b + $c; });
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4iIs6
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'reduce'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 2
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F4iIs6%3A7%240'
    9     4        SEND_VAL                                                 ~0
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function reduce:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4iIs6
function name:  reduce
number of ops:  11
compiled vars:  !0 = $a, !1 = $b, !2 = $reducer
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                                        !2
          4        SEND_VAR_EX                                              !0
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0  $3      
          7        VERIFY_RETURN_TYPE                                       $3
          8      > RETURN                                                   $3
    5     9*       VERIFY_RETURN_TYPE                                       
         10*     > RETURN                                                   null

End of function reduce

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

End of function %00%7Bclosure%7D%2Fin%2F4iIs6%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.21 ms | 1399 KiB | 14 Q