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] ]; $total = 0; foreach ($array as ['Name' => $n]) { $total += $n[0] === 'A'; } echo $total;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/T73YC
function name:  (null)
number of ops:  14
compiled vars:  !0 = $array, !1 = $total, !2 = $n
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   11     1        ASSIGN                                                       !1, 0
   12     2      > FE_RESET_R                                           $5      !0, ->11
          3    > > FE_FETCH_R                                                   $5, $6, ->11
          4    >   FETCH_LIST_R                                         $7      $6, 'Name'
          5        ASSIGN                                                       !2, $7
          6        FREE                                                         $6
   13     7        FETCH_DIM_R                                          ~9      !2, 0
          8        IS_IDENTICAL                                         ~10     ~9, 'A'
          9        ASSIGN_OP                                         1          !1, ~10
   12    10      > JMP                                                          ->3
         11    >   FE_FREE                                                      $5
   15    12        ECHO                                                         !1
   16    13      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
155.61 ms | 1578 KiB | 13 Q