3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array(74.6779,25.918,44.9589); $total = array_sum($arr); $total_percentage = 0; foreach($arr as $total_item) { $percentage = ($total_item*100)/$total; echo $percentage; echo "\n"; $total_percentage += $percentage; } echo $total_precentage;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/en5aD
function name:  (null)
number of ops:  18
compiled vars:  !0 = $arr, !1 = $total, !2 = $total_percentage, !3 = $total_item, !4 = $percentage, !5 = $total_precentage
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'array_sum'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $7      
          4        ASSIGN                                                   !1, $7
    6     5        ASSIGN                                                   !2, 0
    8     6      > FE_RESET_R                                       $10     !0, ->15
          7    > > FE_FETCH_R                                               $10, !3, ->15
   10     8    >   MUL                                              ~11     !3, 100
          9        DIV                                              ~12     ~11, !1
         10        ASSIGN                                                   !4, ~12
   11    11        ECHO                                                     !4
   12    12        ECHO                                                     '%0A'
   13    13        ASSIGN_OP                                     1          !2, !4
    8    14      > JMP                                                      ->7
         15    >   FE_FREE                                                  $10
   15    16        ECHO                                                     !5
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.89 ms | 1386 KiB | 15 Q