3v4l.org

run code in 300+ PHP versions simultaneously
<?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']); }
Output for git.master, git.master_jit, rfc.property-hooks
object(ArrayObject)#1 (1) { ["storage":"ArrayObject":private]=> array(1) { ["foo"]=> NULL } } object array access: bool(false) Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, ArrayObject given in /in/16e5v:11 Stack trace: #0 {main} thrown in /in/16e5v on line 11
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
60.86 ms | 401 KiB | 8 Q