3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [1, 4, 3, 0, 5]; $product = array_reduce($array, function ($c, $v) { return $c * ($v == 0 ? 1 : $v); }, 1); echo $product; $product = array_product(array_filter($array)); echo $product;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5N9qN
function name:  (null)
number of ops:  18
compiled vars:  !0 = $array, !1 = $product
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'array_reduce'
          2        SEND_VAR                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                          ~3      [0]
          4        SEND_VAL                                                 ~3
          5        SEND_VAL                                                 1
          6        DO_ICALL                                         $4      
          7        ASSIGN                                                   !1, $4
    6     8        ECHO                                                     !1
    7     9        INIT_FCALL                                               'array_product'
         10        INIT_FCALL                                               'array_filter'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $6      
         13        SEND_VAR                                                 $6
         14        DO_ICALL                                         $7      
         15        ASSIGN                                                   !1, $7
    8    16        ECHO                                                     !1
    9    17      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5N9qN
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $c, !1 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        IS_EQUAL                                                 !1, 0
          3      > JMPZ                                                     ~2, ->6
          4    >   QM_ASSIGN                                        ~3      1
          5      > JMP                                                      ->7
          6    >   QM_ASSIGN                                        ~3      !1
          7    >   MUL                                              ~4      !0, ~3
          8      > RETURN                                                   ~4
          9*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.86 ms | 955 KiB | 16 Q