3v4l.org

run code in 300+ PHP versions simultaneously
<?php function rsum($v, $w) { $v += $w; return $v; } function rmul($v, $w) { $v *= $w; return $v; } $a = array(1, 2, 3, 4, 5); $x = array(); $b = array_reduce($a, "rsum"); print_r($b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LfHnP
function name:  (null)
number of ops:  11
compiled vars:  !0 = $a, !1 = $x, !2 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, <array>
   15     1        ASSIGN                                                   !1, <array>
   16     2        INIT_FCALL                                               'array_reduce'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 'rsum'
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !2, $5
   17     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

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

End of function rsum

Function rmul:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LfHnP
function name:  rmul
number of ops:  5
compiled vars:  !0 = $v, !1 = $w
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        ASSIGN_OP                                     3          !0, !1
   11     3      > RETURN                                                   !0
   12     4*     > RETURN                                                   null

End of function rmul

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.35 ms | 1395 KiB | 17 Q