3v4l.org

run code in 500+ PHP versions simultaneously
<?php if (!function_exists('get_error_handler')) { function noop_error_handler() { } function get_error_handler(): ?callable { $handler = set_error_handler('noop_error_handler'); restore_error_handler(); return $handler; } } $handler = function (int $errno, string $errstr, ?string $errfile, ?int $errline) { echo "Error: " . $errstr . "\n"; }; set_error_handler($handler); $ab = get_error_handler(); print_R($ab); set_error_handler(function() { $a(); print 123;} ); echo $a;
Output for rfc.property-hooks
Closure Object ( [parameter] => Array ( [$errno] => <required> [$errstr] => <required> [$errfile] => <required> [$errline] => <required> ) ) Warning: Undefined variable $a in /in/17WbC on line 26 Fatal error: Uncaught Error: Value of type null is not callable in /in/17WbC:26 Stack trace: #0 /in/17WbC(30): {closure}(2, 'Undefined varia...', '/in/17WbC', 30) #1 {main} thrown in /in/17WbC on line 26
Process exited with code 255.
Output for git.master, git.master_jit
Closure Object ( [name] => {closure:/in/17WbC:13} [file] => /in/17WbC [line] => 13 [parameter] => Array ( [$errno] => <required> [$errstr] => <required> [$errfile] => <required> [$errline] => <required> ) ) Warning: Undefined variable $a in /in/17WbC on line 26 Fatal error: Uncaught Error: Value of type null is not callable in /in/17WbC:26 Stack trace: #0 /in/17WbC(30): {closure:/in/17WbC:24}(2, 'Undefined varia...', '/in/17WbC', 30) #1 {main} thrown in /in/17WbC on line 26
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:
49.48 ms | 2833 KiB | 4 Q