3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public function dosomething() { echo "doing :-) " . get_class($this) . PHP_EOL; } } class Caller { public function test() { A::dosomething(); } } $c = new Caller(); $c->test();

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for Typed properties v2
Deprecated: Non-static method A::dosomething() should not be called statically in /in/TvnV2 on line 13 Notice: Undefined variable: this in /in/TvnV2 on line 5 doing :-) A
Output for Array change keys
Deprecated: Non-static method A::dosomething() should not be called statically in /in/TvnV2 on line 13 Notice: Undefined variable: this in /in/TvnV2 on line 5 doing :-) A
Output for Lexical anon
Deprecated: Non-static method A::dosomething() should not be called statically, assuming $this from incompatible context in /in/TvnV2 on line 13 doing :-) Caller

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