3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Users{ $user; $pass; function setUser($user){ $this->user = $user; } function setPass($pass){ $this->pass = $pass; } function getUser(){ return $this->user; } function getPass(){ return $this->pass; } } $user = new Users(); $user->setUser('Anderson'); echo $user->getUser();
Output for 5.4.0 - 5.4.27
Parse error: syntax error, unexpected '$user' (T_VARIABLE), expecting function (T_FUNCTION) in /in/WWjBo on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /in/WWjBo on line 3
Process exited with code 255.