3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class UserData{ public $user; public $userid; const NAME = "abdullah al mamun"; public static $age = "30"; public function __construct($username, $userid){ $this->user = $username; $this->userid = $userid; echo "Username is {$this->user} and user id is{$this->userid}"; } public function display(){ echo "Full name is :".UserData::NAME."<br/>"; echo "Age is :".self::$age; } public function __destruct(){ unset($this->user); unset($this->userid); } } $user = "mamun"; $id = "25"; $ur = new UserData($user, $id); ?>
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.0
Username is mamun and user id is25