3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '{ "google.com": { "clicks": 23, "browsers": { "Chrome": 19, "Mozilla": 2, "Safari": 1 } }, "mcnitro.net": { "clicks": 87, "browsers": { "Chrome": 19, "Mozilla": 2, "Safari": 1 } } }'; //$jsonString = file_get_contents('stats.json'); $data = json_decode($str, true); foreach($data as $key => $domain) { echo $key . "\n"; echo $domain['clicks'] . "\n\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/D7FCY
function name:  (null)
number of ops:  17
compiled vars:  !0 = $str, !1 = $data, !2 = $domain, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7B%0A+++%22google.com%22%3A+%7B%0A++++++++%22clicks%22%3A+23%2C%0A++++++++%22browsers%22%3A+%7B%0A++++++++++++%22Chrome%22%3A+19%2C%0A++++++++++++%22Mozilla%22%3A+2%2C%0A++++++++++++%22Safari%22%3A+1%0A++++++++%7D%0A++++%7D%2C%0A++++%22mcnitro.net%22%3A+%7B%0A++++++++%22clicks%22%3A+87%2C%0A++++++++%22browsers%22%3A+%7B%0A++++++++++++%22Chrome%22%3A+19%2C%0A++++++++++++%22Mozilla%22%3A+2%2C%0A++++++++++++%22Safari%22%3A+1%0A++++++++%7D%0A++++%7D%0A%7D'
   23     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
   24     6      > FE_RESET_R                                       $7      !1, ->15
          7    > > FE_FETCH_R                                       ~8      $7, !2, ->15
          8    >   ASSIGN                                                   !3, ~8
   25     9        CONCAT                                           ~10     !3, '%0A'
         10        ECHO                                                     ~10
   26    11        FETCH_DIM_R                                      ~11     !2, 'clicks'
         12        CONCAT                                           ~12     ~11, '%0A%0A'
         13        ECHO                                                     ~12
   24    14      > JMP                                                      ->7
         15    >   FE_FREE                                                  $7
   28    16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.91 ms | 1005 KiB | 14 Q