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($a); set_error_handler(function() { $a(); print 123;} ); echo $a;
Output for git.master_jit, git.master
Error: Undefined variable $a Warning: Undefined variable $a in /in/nLGf4 on line 26 Fatal error: Uncaught Error: Value of type null is not callable in /in/nLGf4:26 Stack trace: #0 /in/nLGf4(30): {closure:/in/nLGf4:24}(2, 'Undefined varia...', '/in/nLGf4', 30) #1 {main} thrown in /in/nLGf4 on line 26
Process exited with code 255.
Output for rfc.property-hooks
Error: Undefined variable $a Warning: Undefined variable $a in /in/nLGf4 on line 26 Fatal error: Uncaught Error: Value of type null is not callable in /in/nLGf4:26 Stack trace: #0 /in/nLGf4(30): {closure}(2, 'Undefined varia...', '/in/nLGf4', 30) #1 {main} thrown in /in/nLGf4 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:
45.72 ms | 2775 KiB | 4 Q