3v4l.org

run code in 300+ PHP versions simultaneously
<?php class User { private $username; protected $password; function __construct(){ $this->username = 'test'; } public function login() { return 'login'; } public function register() { return 'register'; } } class Teacher extends User { public $id; public $name; public $description; public $email; public $phone; function __construct(){ parent::__construct(); } public function getUsername() { return $this->username; } public function getPassword() { return $this->password; } } $o = new Teacher(); var_dump($o->getUsername());
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined property: Teacher::$username in /in/I2XW1 on line 43 NULL

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:
54.93 ms | 1497 KiB | 4 Q