3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = [ 123 => ['name' => 'xxx'], 456 => ['name' => 'yyy'], ]; echo \array_key_exists(123, $x) ? 'yes' : 'no'; echo "\n"; $x = [ ['id' => 123, 'name' => 'xxx'], ['id' => 456, 'name' => 'yyy'], ]; // if array child id === 123 in any of the children, // then echo yes, // (without using a loop, and by using an array function)
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IPOTc
function name:  (null)
number of ops:  10
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    8     1        ARRAY_KEY_EXISTS                                         123, !0
          2      > JMPZ                                                     ~2, ->5
          3    >   QM_ASSIGN                                        ~3      'yes'
          4      > JMP                                                      ->6
          5    >   QM_ASSIGN                                        ~3      'no'
          6    >   ECHO                                                     ~3
    9     7        ECHO                                                     '%0A'
   11     8        ASSIGN                                                   !0, <array>
   18     9      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.13 ms | 1397 KiB | 13 Q