- Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.30, 8.2.0 - 8.2.25, 8.3.0 - 8.3.14, 8.4.1
- Exists Exists Exists
<?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";
}
}