3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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']); }
based on kOVRn
Output for 5.6.38, hhvm-3.18.5 - 3.22.0, 7.1.0 - 7.2.10
object(ArrayObject)#1 (1) { ["storage":"ArrayObject":private]=> array(1) { ["foo"]=> NULL } } object array access: bool(false) bool(true) bool(false) NULL