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 git.master_jit, git.master
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 Directory: Error: Cannot directly construct Directory, use dir() instead XMLParser: Error: Cannot directly construct XMLParser, use xml_parser_create() or xml_parser_create_ns() instead

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
35.17 ms | 407 KiB | 5 Q