3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = json_decode('[ { "label": "vvk", "data": [ [ "1404054000000", 6 ], [ "1405353600000", 10 ] ] }, { "label": "vrij", "data": [ [ "1404054000000", 4 ], [ "1405353600000", 8 ] ] }, { "label": "online", "data": [ [ "1405347300000", 1 ], [ "1405348200000", 2 ] ] }, { "label": "ADK", "data": [ [ "1405353600000", 5 ] ] }, { "label": "ADK Kind", "data": [ [ "1405353600000", 4 ] ] } ]', true); foreach($data as $typeOfTicket) { $sum = 0; foreach($typeOfTicket['data'] as $ticket) { $sum = $sum + $ticket[1]; } echo $typeOfTicket['label'] . ': ' . $sum; } //echo $data;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 21
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 21
Branch analysis from position: 7
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 15
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/1aH9C
function name:  (null)
number of ops:  23
compiled vars:  !0 = $data, !1 = $typeOfTicket, !2 = $sum, !3 = $ticket
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'json_decode'
          1        SEND_VAL                                                 '%5B%0A++++%7B%0A++++++++%22label%22%3A+%22vvk%22%2C%0A++++++++%22data%22%3A+%5B%0A++++++++++++%5B%0A++++++++++++++++%221404054000000%22%2C%0A++++++++++++++++6%0A++++++++++++%5D%2C%0A++++++++++++%5B%0A++++++++++++++++%221405353600000%22%2C%0A++++++++++++++++10%0A++++++++++++%5D%0A++++++++%5D%0A++++%7D%2C%0A++++%7B%0A++++++++%22label%22%3A+%22vrij%22%2C%0A++++++++%22data%22%3A+%5B%0A++++++++++++%5B%0A++++++++++++++++%221404054000000%22%2C%0A++++++++++++++++4%0A++++++++++++%5D%2C%0A++++++++++++%5B%0A++++++++++++++++%221405353600000%22%2C%0A++++++++++++++++8%0A++++++++++++%5D%0A++++++++%5D%0A++++%7D%2C%0A++++%7B%0A++++++++%22label%22%3A+%22online%22%2C%0A++++++++%22data%22%3A+%5B%0A++++++++++++%5B%0A++++++++++++++++%221405347300000%22%2C%0A++++++++++++++++1%0A++++++++++++%5D%2C%0A++++++++++++%5B%0A++++++++++++++++%221405348200000%22%2C%0A++++++++++++++++2%0A++++++++++++%5D%0A++++++++%5D%0A++++%7D%2C%0A++++%7B%0A++++++++%22label%22%3A+%22ADK%22%2C%0A++++++++%22data%22%3A+%5B%0A++++++++++++%5B%0A++++++++++++++++%221405353600000%22%2C%0A++++++++++++++++5%0A++++++++++++%5D%0A++++++++%5D%0A++++%7D%2C%0A++++%7B%0A++++++++%22label%22%3A+%22ADK+Kind%22%2C%0A++++++++%22data%22%3A+%5B%0A++++++++++++%5B%0A++++++++++++++++%221405353600000%22%2C%0A++++++++++++++++4%0A++++++++++++%5D%0A++++++++%5D%0A++++%7D%0A%5D'
   61     2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $4      
    3     4        ASSIGN                                                   !0, $4
   63     5      > FE_RESET_R                                       $6      !0, ->21
          6    > > FE_FETCH_R                                               $6, !1, ->21
   64     7    >   ASSIGN                                                   !2, 0
   66     8        FETCH_DIM_R                                      ~8      !1, 'data'
          9      > FE_RESET_R                                       $9      ~8, ->15
         10    > > FE_FETCH_R                                               $9, !3, ->15
   67    11    >   FETCH_DIM_R                                      ~10     !3, 1
         12        ADD                                              ~11     !2, ~10
         13        ASSIGN                                                   !2, ~11
   66    14      > JMP                                                      ->10
         15    >   FE_FREE                                                  $9
   70    16        FETCH_DIM_R                                      ~13     !1, 'label'
         17        CONCAT                                           ~14     ~13, '%3A+'
         18        CONCAT                                           ~15     ~14, !2
         19        ECHO                                                     ~15
   63    20      > JMP                                                      ->6
         21    >   FE_FREE                                                  $6
   73    22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.28 ms | 1400 KiB | 15 Q