3v4l.org

run code in 300+ PHP versions simultaneously
<?php $source_json = <<<JSON { "success": true, "test2": [ [ [ { "nama": "Henru Kay", "date": "29 Apr 2019" }, { "nama": "B", "date": "28 Apr 2019" } ] ], [ [ { "nama": "C", "date": "25 Apr 2019" } ] ] ] } JSON; $source_array = json_decode($source_json, true); array_walk($source_array['test2'], function(&$value) { $value = iterator_to_array(new RecursiveIteratorIterator(new RecursiveArrayIterator($value))); }); echo json_encode($source_array, JSON_PRETTY_PRINT);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uo6kZ
function name:  (null)
number of ops:  18
compiled vars:  !0 = $source_json, !1 = $source_array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7B%0A++++%22success%22%3A+true%2C%0A++++%22test2%22%3A+%5B%0A++++++++%5B%0A++++++++++++%5B%0A++++++++++++++++%7B%0A++++++++++++++++++++%22nama%22%3A+%22Henru+Kay%22%2C%0A++++++++++++++++++++%22date%22%3A+%2229+Apr+2019%22%0A++++++++++++++++%7D%2C%0A++++++++++++++++%7B%0A++++++++++++++++++++%22nama%22%3A+%22B%22%2C%0A++++++++++++++++++++%22date%22%3A+%2228+Apr+2019%22%0A++++++++++++++++%7D%0A++++++++++++%5D%0A++++++++%5D%2C%0A++++++++%5B%0A++++++++++++%5B%0A++++++++++++++++%7B%0A++++++++++++++++++++%22nama%22%3A+%22C%22%2C%0A++++++++++++++++++++%22date%22%3A+%2225+Apr+2019%22%0A++++++++++++++++%7D%0A++++++++++++%5D%0A++++++++%5D%0A++++%5D%0A%7D'
   31     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
   33     6        INIT_FCALL                                               'array_walk'
          7        FETCH_DIM_W                                      $5      !1, 'test2'
          8        SEND_REF                                                 $5
          9        DECLARE_LAMBDA_FUNCTION                          ~6      [0]
   35    10        SEND_VAL                                                 ~6
   33    11        DO_ICALL                                                 
   37    12        INIT_FCALL                                               'json_encode'
         13        SEND_VAR                                                 !1
         14        SEND_VAL                                                 128
         15        DO_ICALL                                         $8      
         16        ECHO                                                     $8
         17      > 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/uo6kZ
function name:  {closure}
number of ops:  12
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   RECV                                             !0      
   34     1        INIT_FCALL                                               'iterator_to_array'
          2        NEW                                              $1      'RecursiveIteratorIterator'
          3        NEW                                              $2      'RecursiveArrayIterator'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6        SEND_VAR_NO_REF_EX                                       $2
          7        DO_FCALL                                      0          
          8        SEND_VAR                                                 $1
          9        DO_ICALL                                         $5      
         10        ASSIGN                                                   !0, $5
   35    11      > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
221.83 ms | 1006 KiB | 17 Q