3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '[{"name":null,"value":"","target":null,"alias":"brand","required":1,"showNull":0}]'; var_export(json_decode($json)); echo "\n---\n"; foreach (json_decode($json ?? '[]') as $row) { if ($row->alias === 'brand') { echo $row->value; break; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 22
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 22
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 21
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 22
Branch analysis from position: 22
filename:       /in/jXGMH
function name:  (null)
number of ops:  24
compiled vars:  !0 = $json, !1 = $row
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   ASSIGN                                                   !0, '%5B%7B%22name%22%3Anull%2C%22value%22%3A%22%22%2C%22target%22%3Anull%2C%22alias%22%3A%22brand%22%2C%22required%22%3A1%2C%22showNull%22%3A0%7D%5D'
   4     1        INIT_FCALL                                               'var_export'
         2        INIT_FCALL                                               'json_decode'
         3        SEND_VAR                                                 !0
         4        DO_ICALL                                         $3      
         5        SEND_VAR                                                 $3
         6        DO_ICALL                                                 
   5     7        ECHO                                                     '%0A---%0A'
   7     8        INIT_FCALL                                               'json_decode'
         9        COALESCE                                         ~5      !0
        10        QM_ASSIGN                                        ~5      '%5B%5D'
        11        SEND_VAL                                                 ~5
        12        DO_ICALL                                         $6      
        13      > FE_RESET_R                                       $7      $6, ->22
        14    > > FE_FETCH_R                                               $7, !1, ->22
   8    15    >   FETCH_OBJ_R                                      ~8      !1, 'alias'
        16        IS_NOT_IDENTICAL                                 ~9      ~8, 'brand'
        17      > JMPZ                                                     ~9, ->21
   9    18    >   FETCH_OBJ_R                                      ~10     !1, 'value'
        19        ECHO                                                     ~10
  10    20      > JMP                                                      ->22
   7    21    > > JMP                                                      ->14
        22    >   FE_FREE                                                  $7
  12    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
11.33 ms | 411 KiB | 7 Q