3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_error_handler(function ($errno, $errstr) { global $errored; $errored = TRUE; return TRUE; }); $errored = FALSE; var_dump( array_filter( get_declared_classes(), function ($className) use (&$errored) { $errored = FALSE; if (!(new ReflectionClass($className))->hasMethod('__toString') && $className !== "Closure" && substr($className, 7) !== "SQLite3") { try { $x = new $className; $x = (string)$x; return $errored; } catch (Exception $e) { return FALSE; } } return FALSE; } ) );

preferences:
41.83 ms | 402 KiB | 5 Q