3v4l.org

run code in 300+ PHP versions simultaneously
<?php $testOne = array ( 'Smith'=> 98, 'Johnson' => 67, ); $testTwo = array ( 'Smith'=> 100, 'Johnson' => 85, ); $testThree = array ( 'Smith'=> 78, 'Johnson' => 92, ); $testFour = array ( 'Smith'=> 91, 'Johnson' => 88, ); $total = [$testOne, $testTwo, $testThree, $testFour]; Foreach($total[0] as $name => $val){ $averages[$name] = array_sum(array_column($total, $name))/count($total); } var_dump($averages);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 25
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 25
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/Lk1aL
function name:  (null)
number of ops:  30
compiled vars:  !0 = $testOne, !1 = $testTwo, !2 = $testThree, !3 = $testFour, !4 = $total, !5 = $val, !6 = $name, !7 = $averages
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, <array>
   13     2        ASSIGN                                                   !2, <array>
   18     3        ASSIGN                                                   !3, <array>
   23     4        INIT_ARRAY                                       ~12     !0
          5        ADD_ARRAY_ELEMENT                                ~12     !1
          6        ADD_ARRAY_ELEMENT                                ~12     !2
          7        ADD_ARRAY_ELEMENT                                ~12     !3
          8        ASSIGN                                                   !4, ~12
   25     9        FETCH_DIM_R                                      ~14     !4, 0
         10      > FE_RESET_R                                       $15     ~14, ->25
         11    > > FE_FETCH_R                                       ~16     $15, !5, ->25
         12    >   ASSIGN                                                   !6, ~16
   26    13        INIT_FCALL                                               'array_sum'
         14        INIT_FCALL                                               'array_column'
         15        SEND_VAR                                                 !4
         16        SEND_VAR                                                 !6
         17        DO_ICALL                                         $19     
         18        SEND_VAR                                                 $19
         19        DO_ICALL                                         $20     
         20        COUNT                                            ~21     !4
         21        DIV                                              ~22     $20, ~21
         22        ASSIGN_DIM                                               !7, !6
         23        OP_DATA                                                  ~22
   25    24      > JMP                                                      ->11
         25    >   FE_FREE                                                  $15
   28    26        INIT_FCALL                                               'var_dump'
         27        SEND_VAR                                                 !7
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.37 ms | 1005 KiB | 16 Q