3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_error_handler(function ($errno, $errstr, $errfile, $errline) { $namespace = 'ajf\ErrorExceptions\Dynamic'; $className = implode('', explode(' ', ucwords($errstr))); eval("namespace $namespace { class $className extends \ErrorException {} }"); $fullClassName = $namespace . '\\' . $className; throw new $fullClassName($errstr, 0, $errno, $errfile, $errline); }); try { $repent = sin("123abc"); } catch (ajf\ErrorExceptions\Dynamic\ANonWellFormedNumericValueEncountered $e) { echo "praise be to zend_is_numeric_string_ex: $e"; }

preferences:
44.44 ms | 402 KiB | 5 Q