3v4l.org

run code in 300+ PHP versions simultaneously
<?php $filtered_decoded[0]['data'] = array( array( 'position' => 2, 'date' => '2013-01-02' ), array( 'position' => 3, 'date' => '2013-01-03' ) ); $filtered_decoded[1]['data'] = array( array( 'position' => 8, 'date' => '2013-01-02' ), array( 'position' => 5, 'date' => '2013-01-03' ) ); $converteddatesarray = array(); print_r($filtered_decoded); foreach ($filtered_decoded['data'] as $key => $list) { $converteddatesarray[] = '['.strtotime($list['date']).'000,'.$list['position'].']'; } $test .= '{"name":"'.$name.'","data":['. implode(",",$converteddatesarray).']},'; echo '['.rtrim($test,",").']';
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 26
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 26
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/IvcWn
function name:  (null)
number of ops:  44
compiled vars:  !0 = $filtered_decoded, !1 = $converteddatesarray, !2 = $list, !3 = $key, !4 = $test, !5 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   FETCH_DIM_W                                      $6      !0, 0
          1        ASSIGN_DIM                                               $6, 'data'
    5     2        OP_DATA                                                  <array>
   13     3        FETCH_DIM_W                                      $8      !0, 1
          4        ASSIGN_DIM                                               $8, 'data'
   15     5        OP_DATA                                                  <array>
   26     6        ASSIGN                                                   !1, <array>
   28     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
   29    10        FETCH_DIM_R                                      ~12     !0, 'data'
         11      > FE_RESET_R                                       $13     ~12, ->26
         12    > > FE_FETCH_R                                       ~14     $13, !2, ->26
         13    >   ASSIGN                                                   !3, ~14
   30    14        INIT_FCALL                                               'strtotime'
         15        FETCH_DIM_R                                      ~17     !2, 'date'
         16        SEND_VAL                                                 ~17
         17        DO_ICALL                                         $18     
         18        CONCAT                                           ~19     '%5B', $18
         19        CONCAT                                           ~20     ~19, '000%2C'
         20        FETCH_DIM_R                                      ~21     !2, 'position'
         21        CONCAT                                           ~22     ~20, ~21
         22        CONCAT                                           ~23     ~22, '%5D'
         23        ASSIGN_DIM                                               !1
         24        OP_DATA                                                  ~23
   29    25      > JMP                                                      ->12
         26    >   FE_FREE                                                  $13
   33    27        CONCAT                                           ~24     '%7B%22name%22%3A%22', !5
         28        CONCAT                                           ~25     ~24, '%22%2C%22data%22%3A%5B'
         29        INIT_FCALL                                               'implode'
         30        SEND_VAL                                                 '%2C'
         31        SEND_VAR                                                 !1
         32        DO_ICALL                                         $26     
         33        CONCAT                                           ~27     ~25, $26
         34        CONCAT                                           ~28     ~27, '%5D%7D%2C'
         35        ASSIGN_OP                                     8          !4, ~28
   35    36        INIT_FCALL                                               'rtrim'
         37        SEND_VAR                                                 !4
         38        SEND_VAL                                                 '%2C'
         39        DO_ICALL                                         $30     
         40        CONCAT                                           ~31     '%5B', $30
         41        CONCAT                                           ~32     ~31, '%5D'
         42        ECHO                                                     ~32
         43      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.51 ms | 1400 KiB | 21 Q