3v4l.org

run code in 500+ PHP versions simultaneously
<?php $json_data = array ( 'data' => array ( 0 => array ( 'title' => 'currency1', 'tickers' => array ( 0 => 'USD' ), ), 1 => array ( 'title' => 'currency2', 'tickers' => array ( 0 => 'USD', 1 => 'EUR' ), ), 2 => array ( 'title' => 'currency3', 'tickers' => array ( 0 => 'USD' ), ) ) ); foreach ($json_data['data'] as $key => $story) { $tickers = $story['tickers']; if (count($tickers) != 1) continue; $title = $story['title']; echo "$title Key is $key and tickers is {$tickers[0]}\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 22
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 22
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 11
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/lrVve
function name:  (null)
number of ops:  24
compiled vars:  !0 = $json_data, !1 = $story, !2 = $key, !3 = $tickers, !4 = $title
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   37     1        FETCH_DIM_R                                          ~6      !0, 'data'
          2      > FE_RESET_R                                           $7      ~6, ->22
          3    > > FE_FETCH_R                                           ~8      $7, !1, ->22
          4    >   ASSIGN                                                       !2, ~8
   38     5        FETCH_DIM_R                                          ~10     !1, 'tickers'
          6        ASSIGN                                                       !3, ~10
   39     7        COUNT                                                ~12     !3
          8        IS_NOT_EQUAL                                                 ~12, 1
          9      > JMPZ                                                         ~13, ->11
         10    > > JMP                                                          ->3
   40    11    >   FETCH_DIM_R                                          ~14     !1, 'title'
         12        ASSIGN                                                       !4, ~14
   41    13        ROPE_INIT                                         6  ~18     !4
         14        ROPE_ADD                                          1  ~18     ~18, '+Key+is+'
         15        ROPE_ADD                                          2  ~18     ~18, !2
         16        ROPE_ADD                                          3  ~18     ~18, '+and+tickers+is+'
         17        FETCH_DIM_R                                          ~16     !3, 0
         18        ROPE_ADD                                          4  ~18     ~18, ~16
         19        ROPE_END                                          5  ~17     ~18, '%0A'
         20        ECHO                                                         ~17
   37    21      > JMP                                                          ->3
         22    >   FE_FREE                                                      $7
   42    23      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.67 ms | 1998 KiB | 13 Q