3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = <<<EOJ { "a": 1, "b": "banana", "c": { "x": 1, "y": 2, "z": [{"id":5},{"id":6},{"id":7}] } } EOJ; $arr = json_decode($json); foreach ($arr->c->z as $o) { echo $o->id, ', '; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/19dLd
function name:  (null)
number of ops:  15
compiled vars:  !0 = $json, !1 = $arr, !2 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%7B%0A++%22a%22%3A+1%2C%0A++%22b%22%3A+%22banana%22%2C%0A++%22c%22%3A+%7B%0A++++%22x%22%3A+1%2C%0A++++%22y%22%3A+2%2C%0A++++%22z%22%3A+%5B%7B%22id%22%3A5%7D%2C%7B%22id%22%3A6%7D%2C%7B%22id%22%3A7%7D%5D%0A++%7D%0A%7D'
   14     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !1, $4
   16     5        FETCH_OBJ_R                                      ~6      !1, 'c'
          6        FETCH_OBJ_R                                      ~7      ~6, 'z'
          7      > FE_RESET_R                                       $8      ~7, ->13
          8    > > FE_FETCH_R                                               $8, !2, ->13
   17     9    >   FETCH_OBJ_R                                      ~9      !2, 'id'
         10        ECHO                                                     ~9
         11        ECHO                                                     '%2C+'
   16    12      > JMP                                                      ->8
         13    >   FE_FREE                                                  $8
   18    14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.95 ms | 1395 KiB | 15 Q