3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array( 78, 60, 62, 68, 71, 68, 73, 85, 66, 64, 76, 63, 75, 76, 73, 68, 62, 73, 72, 65, 74, 62, 62, 65, 64, 68, 73, 75, 79, 73); $i = 0; $counter; $sum = 0; foreach ($a as $key=>$value) { $counter++; $sum += $value; } echo "Average temperature is " . $sum/$counter;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/3hEis
function name:  (null)
number of ops:  14
compiled vars:  !0 = $a, !1 = $i, !2 = $counter, !3 = $sum, !4 = $value, !5 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, 0
    7     2        ASSIGN                                                   !3, 0
    8     3      > FE_RESET_R                                       $9      !0, ->9
          4    > > FE_FETCH_R                                       ~10     $9, !4, ->9
          5    >   ASSIGN                                                   !5, ~10
    9     6        PRE_INC                                                  !2
   10     7        ASSIGN_OP                                     1          !3, !4
    8     8      > JMP                                                      ->4
          9    >   FE_FREE                                                  $9
   13    10        DIV                                              ~14     !3, !2
         11        CONCAT                                           ~15     'Average+temperature+is+', ~14
         12        ECHO                                                     ~15
         13      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.65 ms | 1393 KiB | 13 Q