3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public static string $myStatic = "foo"; } echo "Foo::\$myStatic: " . Foo::$myStatic . "\n"; // foo $foo = new Foo(); echo "\n\$foo->myStatic: " . $foo->myStatic . "\n"; // undefined $foo->myStatic = "bar"; // deprecated echo "\nModified \$foo->myStatic: " . $foo->myStatic . "\n"; // bar Foo::$myStatic = "foobar"; echo "\nModified Foo::\$myStatic: " . Foo::$myStatic . "\n"; // foobar
Output for git.master_jit, git.master
Foo::$myStatic: foo Notice: Accessing static property Foo::$myStatic as non static in /in/bnclg on line 12 Warning: Undefined property: Foo::$myStatic in /in/bnclg on line 12 $foo->myStatic: Notice: Accessing static property Foo::$myStatic as non static in /in/bnclg on line 14 Deprecated: Creation of dynamic property Foo::$myStatic is deprecated in /in/bnclg on line 14 Notice: Accessing static property Foo::$myStatic as non static in /in/bnclg on line 16 Modified $foo->myStatic: bar Modified Foo::$myStatic: foobar

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:
49.78 ms | 407 KiB | 5 Q