3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array('foo' => 42, 'bar' => null); $obj = new ArrayObject($arr); foreach (array($arr, $obj) as $ao) { var_dump($ao); foreach (array('foo', 'bar', 'qux') as $key) { echo "- '$key'\n"; echo 'isset: '; var_dump(isset($ao[$key])); echo 'array_key_exists: '; var_dump(array_key_exists($key, (array)$ao)); unset($ao[$key]); } var_dump($ao); echo "\n"; }

preferences:
29.04 ms | 527 KiB | 12 Q