3v4l.org

run code in 300+ PHP versions simultaneously
<?php function autoload1($class) { echo "1: $class\n"; if ( $class === 'Foo' ) { require '/tmp/autoload1Foo.php'; } } function autoload2($class) { echo "2: $class\n"; require "/tmp/autoload2$class.php"; } file_put_contents( '/tmp/autoload1Foo.php', '<?php class Foo {}' ); file_put_contents( '/tmp/autoload2Bar.php', '<?php class Bar {}' ); spl_autoload_register( 'autoload1' ); spl_autoload_register( 'autoload2' ); $a = new Foo; $b = new Bar;
Output for git.master_jit, git.master, rfc.property-hooks
1: Foo 1: Bar 2: Bar

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:
40.83 ms | 401 KiB | 8 Q