3v4l.org

run code in 300+ 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
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.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
Output for 8.1.32, 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.14
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:
65.75 ms | 412 KiB | 5 Q