3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); use JetBrains\PhpStorm\NoReturn; \set_error_handler(static function (int $errno, string $errstr, string $errfile, int $errline): bool { throw new \ErrorException($errstr, 0, $errno, $errfile, $errline); }); //\register_shutdown_function(static function (): void { // $error = \error_get_last(); // // if ($error !== null) { // throw new \ErrorException($error['message'], 0, $error['type'], $error['file'], $error['line']); // } //}); echo (new class { #[NoReturn] public function __invoke(): string { try { trigger_error('trigger_error was called!', E_USER_ERROR); exit('exit was called!'); return 'Hello, World!'; } catch (\Throwable $e) { return $e->getMessage(); } return 'exit was skipped!'; } })();
Output for git.master, git.master_jit, rfc.property-hooks
trigger_error was called!

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:
73.33 ms | 405 KiB | 5 Q