3v4l.org

run code in 300+ PHP versions simultaneously
<?php $instances_a = array( 'hello' => 'world' ); $instances_ao = new ArrayObject( $instances_a ); $instances_ai = new ArrayIterator( $instances_a ); foreach ( array( $instances_a, $instances_ao, $instances_ai ) as $instances ) { if ( ( is_array( $instances ) && array_key_exists( 'hello', $instances ) ) || isset( $instances[ 'hello' ] ) ) { echo "Exists\n"; } }
Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
Exists Exists Exists

preferences:
107.85 ms | 402 KiB | 122 Q