3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{ "metingen": [ { "label": "06-06-2019 13:13:38", "value": 25.21 }, { "label": "06-06-2019 13:51:04", "value": 27.69 }, { "label": "06-06-2019 13:52:04", "value": 27.69 }, { "label": "06-06-2019 13:53:06", "value": 27.61 }]}'; $jToArr = json_decode($json, true); $res = []; foreach($jToArr['metingen'] as $key => $value){ $res[] = ['x' => $value['label'], 'y' => $value['value']]; } print_r($res);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 18
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 18
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/7hcoJ
function name:  (null)
number of ops:  23
compiled vars:  !0 = $json, !1 = $jToArr, !2 = $res, !3 = $value, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7B%0A%22metingen%22%3A+%5B%0A%7B%0A%22label%22%3A+%2206-06-2019+13%3A13%3A38%22%2C%0A%22value%22%3A+25.21%0A%7D%2C%0A%7B%0A%22label%22%3A+%2206-06-2019+13%3A51%3A04%22%2C%0A%22value%22%3A+27.69%0A%7D%2C%0A%7B%0A%22label%22%3A+%2206-06-2019+13%3A52%3A04%22%2C%0A%22value%22%3A+27.69%0A%7D%2C%0A%7B%0A%22label%22%3A+%2206-06-2019+13%3A53%3A06%22%2C%0A%22value%22%3A+27.61%0A%7D%5D%7D'
   21     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
   22     6        ASSIGN                                                   !2, <array>
   23     7        FETCH_DIM_R                                      ~9      !1, 'metingen'
          8      > FE_RESET_R                                       $10     ~9, ->18
          9    > > FE_FETCH_R                                       ~11     $10, !3, ->18
         10    >   ASSIGN                                                   !4, ~11
   24    11        FETCH_DIM_R                                      ~14     !3, 'label'
         12        INIT_ARRAY                                       ~15     ~14, 'x'
         13        FETCH_DIM_R                                      ~16     !3, 'value'
         14        ADD_ARRAY_ELEMENT                                ~15     ~16, 'y'
         15        ASSIGN_DIM                                               !2
         16        OP_DATA                                                  ~15
   23    17      > JMP                                                      ->9
         18    >   FE_FREE                                                  $10
   26    19        INIT_FCALL                                               'print_r'
         20        SEND_VAR                                                 !2
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.66 ms | 1001 KiB | 15 Q