3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo\Bar { class a {} class b {} function a() { var_dump(__FUNCTION__); } function b() { var_dump(__FUNCTION__); } const a = 1; const b = 2; } namespace PrePhp7 { use Foo\Bar\a; use Foo\Bar\b; use function Foo\Bar\a; use function Foo\Bar\b; use const Foo\Bar\a; use const Foo\Bar\b; echo "\n" . __NAMESPACE__ . "\n"; var_dump(new a()); var_dump(new b()); a(); b(); var_dump(a); var_dump(b); } namespace Php7 { use Foo\Bar\{a, b}; use function Foo\Bar\{a, b}; use const Foo\Bar\{a, b}; echo "\n" . __NAMESPACE__ . "\n"; var_dump(new a()); var_dump(new b()); a(); b(); var_dump(a); var_dump(b); } namespace Php7Mixed { use Foo\Bar\{a, b, function a, function b, const a, const b}; echo "\n" . __NAMESPACE__ . "\n"; var_dump(new a()); var_dump(new b()); a(); b(); var_dump(a); var_dump(b); }
Output for git.master, git.master_jit, rfc.property-hooks
PrePhp7 object(Foo\Bar\a)#1 (0) { } object(Foo\Bar\b)#1 (0) { } string(9) "Foo\Bar\a" string(9) "Foo\Bar\b" int(1) int(2) Php7 object(Foo\Bar\a)#1 (0) { } object(Foo\Bar\b)#1 (0) { } string(9) "Foo\Bar\a" string(9) "Foo\Bar\b" int(1) int(2) Php7Mixed object(Foo\Bar\a)#1 (0) { } object(Foo\Bar\b)#1 (0) { } string(9) "Foo\Bar\a" string(9) "Foo\Bar\b" int(1) int(2)

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