3v4l.org

run code in 300+ PHP versions simultaneously
<?php function average_numbers($nums) { $sum = 0; foreach($nums as $num) $sum += $num; return $sum/count($nums); } $vals = array(3,4,5,6,7); $retValue = average_numbers($vals); echo "<p>$retValue</p>"; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/458Uh
function name:  (null)
number of ops:  10
compiled vars:  !0 = $vals, !1 = $retValue
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   ASSIGN                                                   !0, <array>
   25     1        INIT_FCALL                                               'average_numbers'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                                   !1, $3
   27     5        ROPE_INIT                                     3  ~6      '%3Cp%3E'
          6        ROPE_ADD                                      1  ~6      ~6, !1
          7        ROPE_END                                      2  ~5      ~6, '%3C%2Fp%3E'
          8        ECHO                                                     ~5
   29     9      > RETURN                                                   1

Function average_numbers:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/458Uh
function name:  average_numbers
number of ops:  11
compiled vars:  !0 = $nums, !1 = $sum, !2 = $num
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    7     1        ASSIGN                                                   !1, 0
    9     2      > FE_RESET_R                                       $4      !0, ->6
          3    > > FE_FETCH_R                                               $4, !2, ->6
   11     4    >   ASSIGN_OP                                     1          !1, !2
    9     5      > JMP                                                      ->3
          6    >   FE_FREE                                                  $4
   13     7        COUNT                                            ~6      !0
          8        DIV                                              ~7      !1, ~6
          9      > RETURN                                                   ~7
   15    10*     > RETURN                                                   null

End of function average_numbers

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.28 ms | 1389 KiB | 14 Q