3v4l.org

run code in 300+ PHP versions simultaneously
<?php $file = "2016/11/2 23:49:34,1,2,3,5 <---Array 0 2016/11/2 23:49:35,2,2,3,9 <---Array 1 2016/11/2 23:49:36,0,2,3,5 <---Array 2 2016/11/2 23:49:37,0,5,3,5 <---Array 3 2016/11/2 23:49:38,0,2,3,5 <---Array 4 2016/11/2 23:49:39,1,2,3,5 <---Array 5 2016/11/2 23:49:40,2,2,3,5 <---Array 6 2016/11/2 23:49:41,3,2,3,5 <---Array 7 2016/11/2 23:49:42,4,2,3,5 <---Array 8 2016/11/2 23:49:43,5,2,7,5 <---Array 9 2016/11/2 23:49:44,0,2,3,5 <---Array 10 2016/11/2 23:49:45,0,2,3,5 <---Array 11 2016/11/2 23:49:46,0,3,5,7 <---Array 12"; // $file = file_get_contents('temp.txt'); $rows = explode("\n", $file); $i = 0; $sum = 0; foreach($rows as $row) { //get row data $row_data = explode(',', $row); $data = $row_data[1]; if($i == 1|| $i == 9){ $sum = $sum + $data; } //echo $data; //echo '<br />'; $i++; } echo $sum;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 26
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 26
Branch analysis from position: 10
2 jumps found. (Code = 47) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 24
Branch analysis from position: 21
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/fY6Ke
function name:  (null)
number of ops:  29
compiled vars:  !0 = $file, !1 = $rows, !2 = $i, !3 = $sum, !4 = $row, !5 = $row_data, !6 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '2016%2F11%2F2+23%3A49%3A34%2C1%2C2%2C3%2C5+%3C---Array+0%0A++++2016%2F11%2F2+23%3A49%3A35%2C2%2C2%2C3%2C9+%3C---Array+1%0A++++2016%2F11%2F2+23%3A49%3A36%2C0%2C2%2C3%2C5+%3C---Array+2%0A++++2016%2F11%2F2+23%3A49%3A37%2C0%2C5%2C3%2C5+%3C---Array+3%0A++++2016%2F11%2F2+23%3A49%3A38%2C0%2C2%2C3%2C5+%3C---Array+4%0A++++2016%2F11%2F2+23%3A49%3A39%2C1%2C2%2C3%2C5+%3C---Array+5%0A++++2016%2F11%2F2+23%3A49%3A40%2C2%2C2%2C3%2C5+%3C---Array+6%0A++++2016%2F11%2F2+23%3A49%3A41%2C3%2C2%2C3%2C5+%3C---Array+7%0A++++2016%2F11%2F2+23%3A49%3A42%2C4%2C2%2C3%2C5+%3C---Array+8%0A++++2016%2F11%2F2+23%3A49%3A43%2C5%2C2%2C7%2C5+%3C---Array+9%0A++++2016%2F11%2F2+23%3A49%3A44%2C0%2C2%2C3%2C5+%3C---Array+10%0A++++2016%2F11%2F2+23%3A49%3A45%2C0%2C2%2C3%2C5+%3C---Array+11%0A++++2016%2F11%2F2+23%3A49%3A46%2C0%2C3%2C5%2C7+%3C---Array+12'
   18     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%0A'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $8      
          5        ASSIGN                                                   !1, $8
   19     6        ASSIGN                                                   !2, 0
   20     7        ASSIGN                                                   !3, 0
   21     8      > FE_RESET_R                                       $12     !1, ->26
          9    > > FE_FETCH_R                                               $12, !4, ->26
   24    10    >   INIT_FCALL                                               'explode'
         11        SEND_VAL                                                 '%2C'
         12        SEND_VAR                                                 !4
         13        DO_ICALL                                         $13     
         14        ASSIGN                                                   !5, $13
   25    15        FETCH_DIM_R                                      ~15     !5, 1
         16        ASSIGN                                                   !6, ~15
   26    17        IS_EQUAL                                         ~17     !2, 1
         18      > JMPNZ_EX                                         ~17     ~17, ->21
         19    >   IS_EQUAL                                         ~18     !2, 9
         20        BOOL                                             ~17     ~18
         21    > > JMPZ                                                     ~17, ->24
   27    22    >   ADD                                              ~19     !3, !6
         23        ASSIGN                                                   !3, ~19
   31    24    >   PRE_INC                                                  !2
   21    25      > JMP                                                      ->9
         26    >   FE_FREE                                                  $12
   34    27        ECHO                                                     !3
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.54 ms | 1005 KiB | 14 Q