3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_error_handler(function (int $no, string $str): bool { var_dump('DEBUG: ' . $str); global $level; if ($level !== null) { error_reporting($level); // restore error level unset($level); return true; // handle the internal/helper error } // supress the current error output $level = error_reporting(); error_reporting(0); trigger_error('internal'); // trigger internal/helper error to restore the error level return false; // not handled to set the error_get_last() }); error_reporting(E_ALL); // to show the error, has no effect if the handler is called or not (expected, documented) var_dump(error_reporting()); trigger_error('custom'); // trigger_error('internal2'); // uncomment to reproduce the desired behaviour var_dump(error_get_last()['message']); var_dump(error_reporting());
Output for git.master, git.master_jit, rfc.property-hooks
int(32767) string(13) "DEBUG: custom" string(6) "custom" int(0)

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