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"; }
Output for git.master, git.master_jit, rfc.literals
array(2) { ["foo"]=> int(42) ["bar"]=> NULL } - 'foo' isset: bool(true) array_key_exists: bool(true) - 'bar' isset: bool(false) array_key_exists: bool(true) - 'qux' isset: bool(false) array_key_exists: bool(false) array(0) { } object(ArrayObject)#1 (1) { ["storage":"ArrayObject":private]=> array(2) { ["foo"]=> int(42) ["bar"]=> NULL } } - 'foo' isset: bool(true) array_key_exists: bool(true) - 'bar' isset: bool(false) array_key_exists: bool(true) - 'qux' isset: bool(false) array_key_exists: bool(false) object(ArrayObject)#1 (1) { ["storage":"ArrayObject":private]=> array(0) { } }

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:
51.73 ms | 461 KiB | 5 Q