3v4l.org

run code in 300+ PHP versions simultaneously
<?php /*preg_match('@^(?:http://)?([^/]+)@i','http://www.php.net/index.html',$matches); ${"a"} = $matches[1]; &$a = 12; echo &$a; var_export(${"a"});*/ /*echo ${"a"};*/ /*trait Foo { private $name = '123'; } */ class Bar { //use Foo; private static $name = '321'; public static function getName(){return static::$name;} } class Foo extends Bar{private static $name='123';} $bar = new Foo(); $bar->getName(); /*echo false; class Faz {} class Baz extends Faz {} interface Foo {public function du(Faz $param);} class A implements Foo { public function du(Baz $param){ echo false; } }*//* $i = 5; echo $i++; echo $i;*/ /* namespace Bar; function strlen($string){return 5;} namespace Foo; use Bar; echo strlen('Baz');*/ //var_dump(array_values(ksort(array('re'=>'asd', '3'=>'asda')))); //echo true;
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Cannot access private property Foo::$name in /in/beV8H:16 Stack trace: #0 /in/beV8H(24): Bar::getName() #1 {main} thrown in /in/beV8H on line 16
Process exited with code 255.

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.05 ms | 401 KiB | 8 Q