3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @link http://stackoverflow.com/a/24059368/367456 */ class c1 { public static function f1() { return "hello"; } public static $a = 10; public function f2() { echo $this->f1(); // prints "hello" echo $this->a; // Strict Standards: Accessing static property c1::$a as non static echo $this::$a; // prints "10" (PHP <= 5.2.17: Parse error) } } $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/cBXET on line 17 Warning: Undefined property: c1::$a in /in/cBXET on line 17 10

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