3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = <<<JSON { "code": 200, "unit": null, "data": [ { "2022-11-16": 185.6159202 }, { "2022-11-17": 204.31997631 } ] } JSON; var_export( array_map( fn($item) => ['date' => key($item), 'value' => current($item)], json_decode($json, true)['data'] ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1fn19
function name:  (null)
number of ops:  15
compiled vars:  !0 = $json
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7B%0A++++%22code%22%3A+200%2C%0A++++%22unit%22%3A+null%2C%0A++++%22data%22%3A+%5B%0A++++++++%7B%0A++++++++++++%222022-11-16%22%3A+185.6159202%0A++++++++%7D%2C%0A++++++++%7B%0A++++++++++++%222022-11-17%22%3A+204.31997631%0A++++++++%7D%0A++++%5D%0A%7D'
   18     1        INIT_FCALL                                               'var_export'
   19     2        INIT_FCALL                                               'array_map'
   20     3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
          4        SEND_VAL                                                 ~2
   21     5        INIT_FCALL                                               'json_decode'
          6        SEND_VAR                                                 !0
          7        SEND_VAL                                                 <true>
          8        DO_ICALL                                         $3      
          9        FETCH_DIM_R                                      ~4      $3, 'data'
         10        SEND_VAL                                                 ~4
   19    11        DO_ICALL                                         $5      
   21    12        SEND_VAR                                                 $5
   18    13        DO_ICALL                                                 
   23    14      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1fn19
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'key'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        INIT_ARRAY                                       ~2      $1, 'date'
          5        INIT_FCALL                                               'current'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $3      
          8        ADD_ARRAY_ELEMENT                                ~2      $3, 'value'
          9      > RETURN                                                   ~2
         10*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.42 ms | 1005 KiB | 18 Q