3v4l.org

run code in 500+ PHP versions simultaneously
<?php $classes = get_declared_classes(); foreach ( $classes as $clazz ) { $r = new ReflectionClass( $clazz ); if ( !$r->isInstantiable() ) { continue; } try { new $clazz(); } catch ( ArgumentCountError|TypeError $e ) { // Nothing } catch ( Throwable $e ) { echo $clazz . ": "; echo get_class( $e ) . ': ' . $e->getMessage() . "\n"; } }
Output for 8.5.0 - 8.5.3
Generator: Error: The "Generator" class is reserved for internal use and cannot be manually instantiated WeakReference: Error: Direct instantiation of WeakReference is not allowed, use WeakReference::create instead FiberError: Error: The "FiberError" class is reserved for internal use and cannot be manually instantiated InflateContext: Error: Cannot directly construct InflateContext, use inflate_init() instead DeflateContext: Error: Cannot directly construct DeflateContext, use deflate_init() instead Directory: Error: Cannot directly construct Directory, use dir() instead PDORow: PDOException: You may not create a PDORow manually XMLParser: Error: Cannot directly construct XMLParser, use xml_parser_create() or xml_parser_create_ns() instead
Output for 8.1.32 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18
Generator: Error: The "Generator" class is reserved for internal use and cannot be manually instantiated WeakReference: Error: Direct instantiation of WeakReference is not allowed, use WeakReference::create instead FiberError: Error: The "FiberError" class is reserved for internal use and cannot be manually instantiated InflateContext: Error: Cannot directly construct InflateContext, use inflate_init() instead DeflateContext: Error: Cannot directly construct DeflateContext, use deflate_init() instead PDORow: PDOException: You may not create a PDORow manually XMLParser: Error: Cannot directly construct XMLParser, use xml_parser_create() or xml_parser_create_ns() instead

preferences:
53.99 ms | 903 KiB | 4 Q