3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class DemoFile { public function getError(int $code) : ?string { $error = null; $error = match ($code) { 10 => 'code_10', 11 => 'code_11', }; return $error; } } $demo = new DemoFile(); var_dump($demo->getError(10)); var_dump($demo->getError(11)); var_dump($demo->getError(12));
Output for git.master, git.master_jit, rfc.property-hooks
string(7) "code_10" string(7) "code_11" Fatal error: Uncaught UnhandledMatchError: Unhandled match case 12 in /in/E64Um:9 Stack trace: #0 /in/E64Um(21): DemoFile->getError(12) #1 {main} thrown in /in/E64Um on line 9
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:
41.47 ms | 405 KiB | 5 Q