3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array_fill(0,10000, "ahoj"); $count = 0; $length = 0; foreach($array as $item) { $count += 1; $length += strlen($item); } echo "count: $count, length: $length";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/hcYhe
function name:  (null)
number of ops:  21
compiled vars:  !0 = $array, !1 = $count, !2 = $length, !3 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'array_fill'
          1        SEND_VAL                                                 0
          2        SEND_VAL                                                 10000
          3        SEND_VAL                                                 'ahoj'
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !0, $4
    5     6        ASSIGN                                                   !1, 0
    6     7        ASSIGN                                                   !2, 0
    8     8      > FE_RESET_R                                       $8      !0, ->14
          9    > > FE_FETCH_R                                               $8, !3, ->14
   10    10    >   ASSIGN_OP                                     1          !1, 1
   11    11        STRLEN                                           ~10     !3
         12        ASSIGN_OP                                     1          !2, ~10
    8    13      > JMP                                                      ->9
         14    >   FE_FREE                                                  $8
   14    15        ROPE_INIT                                     4  ~13     'count%3A+'
         16        ROPE_ADD                                      1  ~13     ~13, !1
         17        ROPE_ADD                                      2  ~13     ~13, '%2C+length%3A+'
         18        ROPE_END                                      3  ~12     ~13, !2
         19        ECHO                                                     ~12
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.95 ms | 1386 KiB | 15 Q