3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [ ['Name' => 'Apple', 'Count' => 10], ['Name' => 'Tomato', 'Count' => 23], ['Name' => 'Tree', 'Count' => 4], ['Name' => 'Potato', 'Count' => 44], ['Name' => 'Apple', 'Count' => 73] ]; echo array_reduce( $array, fn($result, $row) => $result + ($row['Name'][0] === 'A'), 0 );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LFeb0
function name:  (null)
number of ops:  9
compiled vars:  !0 = $array
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   11     1        INIT_FCALL                                                   'array_reduce'
   12     2        SEND_VAR                                                     !0
   13     3        DECLARE_LAMBDA_FUNCTION                              ~2      [0]
          4        SEND_VAL                                                     ~2
   14     5        SEND_VAL                                                     0
   11     6        DO_ICALL                                             $3      
   14     7        ECHO                                                         $3
   15     8      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LFeb0
function name:  {closure:/in/LFeb0:13}
number of ops:  8
compiled vars:  !0 = $result, !1 = $row
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        FETCH_DIM_R                                          ~2      !1, 'Name'
          3        FETCH_DIM_R                                          ~3      ~2, 0
          4        IS_IDENTICAL                                         ~4      ~3, 'A'
          5        ADD                                                  ~5      !0, ~4
          6      > RETURN                                                       ~5
          7*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
168.76 ms | 1581 KiB | 14 Q