3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_exception_handler(function(Exception $e) { echo "Didn't work. Here's why: ". $e->getMessage() . PHP_EOL; }); function tryAndDump($array) { var_dump(SplFixedArray::fromArray($array)); var_dump(SplFixedArray::fromArray($array, true)); var_dump(SplFixedArray::fromArray($array, false)); } $null = null; $empty = array(); $norm = array(1, 2, 4); $assoc = array('yup' => 'ok', 'nope' => 'bad'); $mixed = array(1, 2, 'yup' => 'ok', 'nah'); tryAndDump($null); tryAndDump($empty); tryAndDump($norm); tryAndDump($assoc); tryAndDump($mixed);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: {closure}(): Argument #1 ($e) must be of type Exception, TypeError given in /in/QqS6K:3 Stack trace: #0 [internal function]: {closure}(Object(TypeError)) #1 {main} thrown in /in/QqS6K on line 3
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:
42.25 ms | 401 KiB | 8 Q