3v4l.org

run code in 300+ PHP versions simultaneously
<?php $filedata = array('Abid-01-80', 'Sakib-02-76'); $lineArray = array(); $numTotal = 0; foreach ($filedata as $line) { $values = explode('-', $line); $numTotal += $values[2]; $lineArray[$values[0]] = array('id' => $values[1], 'num' => $values[2]); } echo "Total: $numTotal\n"; var_dump($lineArray);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 20
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 20
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/WVcG8
function name:  (null)
number of ops:  29
compiled vars:  !0 = $filedata, !1 = $lineArray, !2 = $numTotal, !3 = $line, !4 = $values
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, <array>
    6     2        ASSIGN                                                   !2, 0
    8     3      > FE_RESET_R                                       $8      !0, ->20
          4    > > FE_FETCH_R                                               $8, !3, ->20
    9     5    >   INIT_FCALL                                               'explode'
          6        SEND_VAL                                                 '-'
          7        SEND_VAR                                                 !3
          8        DO_ICALL                                         $9      
          9        ASSIGN                                                   !4, $9
   10    10        FETCH_DIM_R                                      ~11     !4, 2
         11        ASSIGN_OP                                     1          !2, ~11
   11    12        FETCH_DIM_R                                      ~13     !4, 0
         13        FETCH_DIM_R                                      ~15     !4, 1
         14        INIT_ARRAY                                       ~16     ~15, 'id'
         15        FETCH_DIM_R                                      ~17     !4, 2
         16        ADD_ARRAY_ELEMENT                                ~16     ~17, 'num'
         17        ASSIGN_DIM                                               !1, ~13
         18        OP_DATA                                                  ~16
    8    19      > JMP                                                      ->4
         20    >   FE_FREE                                                  $8
   14    21        ROPE_INIT                                     3  ~19     'Total%3A+'
         22        ROPE_ADD                                      1  ~19     ~19, !2
         23        ROPE_END                                      2  ~18     ~19, '%0A'
         24        ECHO                                                     ~18
   15    25        INIT_FCALL                                               'var_dump'
         26        SEND_VAR                                                 !1
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.4 ms | 1401 KiB | 17 Q