3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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"; }
based on 3NjVB
Output for 7.0.0 - 7.2.0
praise be to zend_is_numeric_string_ex: ajf\ErrorExceptions\Dynamic\ANonWellFormedNumericValueEncountered: A non well formed numeric value encountered in /in/17d5X:14 Stack trace: #0 [internal function]: {closure}(8, 'A non well form...', '/in/17d5X', 14, Array) #1 /in/17d5X(14): sin('123abc') #2 {main}
Output for 5.3.21 - 5.6.28
praise be to zend_is_numeric_string_ex: exception 'ajf\ErrorExceptions\Dynamic\ANonWellFormedNumericValueEncountered' with message 'A non well formed numeric value encountered' in /in/17d5X:14 Stack trace: #0 [internal function]: {closure}(8, 'A non well form...', '/in/17d5X', 14, Array) #1 /in/17d5X(14): sin('123abc') #2 {main}