3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { private $bar; private $file; public __construct($fileName) { $this->bar = 'foobar'; $this->file = $fileName; } // Some more code hereā€¦ public __toString() { return file_get_contents($this->file); } } ?>
Output for 5.4.0 - 5.4.19
Parse error: syntax error, unexpected '__construct' (T_STRING), expecting variable (T_VARIABLE) in /in/QJgtf on line 6
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/QJgtf on line 6
Process exited with code 255.