3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo { class Bar { }; } namespace { use Foo\Bar; class_alias(Bar::class, 'FooBar'); class GuineaPig { public function withNamespace(Bar $bar) { echo sprintf("Passing %s worked with %s\n", get_class($bar), __METHOD__); } public function withoutNamespace(FooBar $bar) { echo sprintf("Passing %s worked with %s\n", get_class($bar), __METHOD__); } } $bar = new Bar(); $foobar = new FooBar(); $pig = new GuineaPig(); $pig->withNamespace($bar); $pig->withNamespace($foobar); $pig->withoutNamespace($bar); $pig->withoutNamespace($foobar); }
Output for git.master, git.master_jit, rfc.property-hooks
Passing Foo\Bar worked with GuineaPig::withNamespace Passing Foo\Bar worked with GuineaPig::withNamespace Passing Foo\Bar worked with GuineaPig::withoutNamespace Passing Foo\Bar worked with GuineaPig::withoutNamespace

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:
108.18 ms | 406 KiB | 5 Q