3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?ph class Foo { public $bar = 'A'; public function doSomething() { $this->bar = 'B'; yield; } } $foo = new Foo(); echo $foo->bar . PHP_EOL; $foo->doSomething(); echo $foo->bar . PHP_EOL;
based on XaIk5
Output for 5.4.0 - 5.4.32
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/275NS on line 3
Process exited with code 255.