3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class a { protected $name = "franz"; public fucntion getName() { return $this->name; } public function setName($name) { $this->name = $name; } } class modify { public __function($a) { $a->setName('john'); } } $a = new a; print $a->getName(); $mod = new modify($a); print $a->getName();
Output for 5.4.0 - 5.4.22
Parse error: syntax error, unexpected 'fucntion' (T_STRING), expecting variable (T_VARIABLE) in /in/5Vhqf on line 5
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/5Vhqf on line 5
Process exited with code 255.