- property_exists: documentation ( source)
- var_dump: documentation ( source)
<?php
$object = new \ArrayObject();
$object['foo'] = null;
var_dump($object);
echo "\nobject array access:\n";
var_dump(isset($object['foo']));
var_dump(array_key_exists('foo', $object));
var_dump(property_exists($object, 'foo'));
if (isset($object['foo']) || array_key_exists('foo', $object)) {
var_dump($object['foo']);
}