3v4l.org

run code in 300+ PHP versions simultaneously
<?php class c1 { public static function f1() { return "hello"; } public static $a = 10; public function f2() { echo $this->f1(); //prints "hello" echo $this->a; //ERROR:Undefined property: c1::$a in C:\wamp\www\class_in_php\example5.php on line 14 } } $obj1 = new c1; $obj1->f2();
Output for git.master, git.master_jit, rfc.property-hooks
hello Notice: Accessing static property c1::$a as non static in /in/sHZWZ on line 15 Warning: Undefined property: c1::$a in /in/sHZWZ on line 15

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