3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { protected $ame = "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/IqafX 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/IqafX on line 5
Process exited with code 255.

preferences:
178.01 ms | 940 KiB | 59 Q