3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = ' { "appendix": { "airlines": [ { "fs": "AA", "iata": "AA", "icao": "AAL", "name": "American Airlines", "phoneNumber": "08457-567-567", "active": true }, { "fs": "LY", "iata": "LY", "icao": "ELY", "name": "El Al", "phoneNumber": "+ 972-3-9771111", "active": true } ] } } '; $temp = json_decode($json,true); $iata = "AA"; foreach ($temp['appendix']['airlines'] as $key => $value) { if($value['iata'] == $iata){ echo $value["name"]."\n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 19
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 19
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 18
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 18
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/AWXHi
function name:  (null)
number of ops:  21
compiled vars:  !0 = $json, !1 = $temp, !2 = $iata, !3 = $value, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%0A%7B%0A++++%22appendix%22%3A+%7B%0A++%22airlines%22%3A+%5B%0A+++%7B%0A++++%22fs%22%3A+%22AA%22%2C%0A++++%22iata%22%3A+%22AA%22%2C%0A++++%22icao%22%3A+%22AAL%22%2C%0A++++%22name%22%3A+%22American+Airlines%22%2C%0A++++%22phoneNumber%22%3A+%2208457-567-567%22%2C%0A++++%22active%22%3A+true%0A+++%7D%2C%0A+++%7B%0A++++%22fs%22%3A+%22LY%22%2C%0A++++%22iata%22%3A+%22LY%22%2C%0A++++%22icao%22%3A+%22ELY%22%2C%0A++++%22name%22%3A+%22El+Al%22%2C%0A++++%22phoneNumber%22%3A+%22%2B+972-3-9771111%22%2C%0A++++%22active%22%3A+true%0A+++%7D%0A+++%5D%0A%7D%0A%7D%0A'
   27     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
   28     6        ASSIGN                                                   !2, 'AA'
   29     7        FETCH_DIM_R                                      ~9      !1, 'appendix'
          8        FETCH_DIM_R                                      ~10     ~9, 'airlines'
          9      > FE_RESET_R                                       $11     ~10, ->19
         10    > > FE_FETCH_R                                       ~12     $11, !3, ->19
         11    >   ASSIGN                                                   !4, ~12
   30    12        FETCH_DIM_R                                      ~14     !3, 'iata'
         13        IS_EQUAL                                                 !2, ~14
         14      > JMPZ                                                     ~15, ->18
   31    15    >   FETCH_DIM_R                                      ~16     !3, 'name'
         16        CONCAT                                           ~17     ~16, '%0A'
         17        ECHO                                                     ~17
   29    18    > > JMP                                                      ->10
         19    >   FE_FREE                                                  $11
   33    20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.08 ms | 999 KiB | 14 Q