3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = []; $keys = [ 'array' => [], 'object' => new stdClass, 'closure' => function () {}, 'class' => new class {}, 'class with tostring' => new class {function __toString(){return 'to string class';}}, 'resource' => fopen(__FILE__, 'r'), ]; foreach ($keys as $desc =>$key) { echo "===" . $desc . "===\n"; $a[$key] = true; echo "state of array: \'n"; var_dump($a); echo "state of key: \n"; var_dump($key); echo "is the key set in the array: \n"; var_dump(isset($a[$key])); } echo "===============\n"; var_dump($a);
Output for git.master, git.master_jit
===array=== Fatal error: Uncaught TypeError: Illegal offset type in /in/3lpob:16 Stack trace: #0 {main} thrown in /in/3lpob on line 16
Process exited with code 255.
Output for rfc.property-hooks
===array=== Fatal error: Uncaught TypeError: Cannot access offset of type array on array in /in/3lpob:16 Stack trace: #0 {main} thrown in /in/3lpob on line 16
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:
58.68 ms | 401 KiB | 8 Q