3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class zyf{ public $a; public $b; function zyf() { $this->$a=4; $this->$b=5; } function add($a,$b) { $c=$a+$b; echo $c; } } $xin = new zyf(); $xin->add(); ?>

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: Methods with the same name as their class will not be constructors in a future version of PHP; zyf has a deprecated constructor in /in/h22jD on line 2 Notice: Undefined variable: a in /in/h22jD on line 6 Fatal error: Uncaught Error: Cannot access empty property in /in/h22jD:6 Stack trace: #0 /in/h22jD(16): zyf->zyf() #1 {main} thrown in /in/h22jD on line 6
Output for Lexical anon
Notice: Undefined variable: a in /in/h22jD on line 6 Fatal error: Cannot access empty property in /in/h22jD on line 6

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