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); $counter = 0; $sum = 0; foreach ($a as $key=>$value) { $counter++; $sum += $value; } echo "COunter $counter"; 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/4gdT7
function name:  (null)
number of ops:  17
compiled vars:  !0 = $a, !1 = $counter, !2 = $sum, !3 = $value, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, 0
    6     2        ASSIGN                                                   !2, 0
    7     3      > FE_RESET_R                                       $8      !0, ->9
          4    > > FE_FETCH_R                                       ~9      $8, !3, ->9
          5    >   ASSIGN                                                   !4, ~9
    8     6        PRE_INC                                                  !1
    9     7        ASSIGN_OP                                     1          !2, !3
    7     8      > JMP                                                      ->4
          9    >   FE_FREE                                                  $8
   12    10        NOP                                                      
         11        FAST_CONCAT                                      ~13     'COunter+', !1
         12        ECHO                                                     ~13
   14    13        DIV                                              ~14     !2, !1
         14        CONCAT                                           ~15     'Average+temperature+is+', ~14
         15        ECHO                                                     ~15
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.25 ms | 1394 KiB | 13 Q