3v4l.org

run code in 300+ PHP versions simultaneously
<?php class UserModel { protected $userName; protected $userPassword; public function __construct($name, $pass) { $this->setName($name) ->setPassword($pass); } public function setName($name) { $this->userName = $name; return $this; } public function setPassword($password) { $this->userPassword = UserModel::hashPassword($password); return $this; } public static function hashPassword($password) { return md5('salt : ' . $password); } public function authenticate($user, $pass) { return ($this->userName === $user && $this->userPassword === UserModel::hashPassword($pass)); } } $user = new UserModel('Spaux','password'); if ($user->authenticate('Spaux','password')) { echo "you've got spaux!"; } else { echo "Who?"; }
Output for git.master, git.master_jit, rfc.property-hooks
you've got spaux!

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
46.89 ms | 401 KiB | 8 Q