3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr='[{"name":"Office","TB":[{"date":[false,true],"time":"8:00 AM"},{"days":[false,true],"time":"6:00 PM"}]}]'; $rr=json_decode($arr); foreach ($rr[0]->TB as $key => $value) { array_walk_recursive($value, function($k,$kk){ echo 'Key is '.$kk.' & Value is '.$k.'<br>'; }); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 16
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/O5oBP
function name:  (null)
number of ops:  18
compiled vars:  !0 = $arr, !1 = $rr, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%5B%7B%22name%22%3A%22Office%22%2C%22TB%22%3A%5B%7B%22date%22%3A%5Bfalse%2Ctrue%5D%2C%22time%22%3A%228%3A00+AM%22%7D%2C%7B%22days%22%3A%5Bfalse%2Ctrue%5D%2C%22time%22%3A%226%3A00+PM%22%7D%5D%7D%5D'
    4     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
    6     5        FETCH_DIM_R                                      ~7      !1, 0
          6        FETCH_OBJ_R                                      ~8      ~7, 'TB'
          7      > FE_RESET_R                                       $9      ~8, ->16
          8    > > FE_FETCH_R                                       ~10     $9, !2, ->16
          9    >   ASSIGN                                                   !3, ~10
    7    10        INIT_FCALL                                               'array_walk_recursive'
         11        SEND_REF                                                 !2
         12        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FO5oBP%3A7%240'
    9    13        SEND_VAL                                                 ~12
         14        DO_ICALL                                                 
    6    15      > JMP                                                      ->8
         16    >   FE_FREE                                                  $9
   10    17      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FO5oBP%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/O5oBP
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $k, !1 = $kk
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        CONCAT                                           ~2      'Key+is+', !1
          3        CONCAT                                           ~3      ~2, '+%26+Value+is+'
          4        CONCAT                                           ~4      ~3, !0
          5        CONCAT                                           ~5      ~4, '%3Cbr%3E'
          6        ECHO                                                     ~5
    9     7      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FO5oBP%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.78 ms | 1396 KiB | 17 Q