3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $store; public function __get($name) { return $this->store[$name] ?? null; } public function __set($name, $value) { $this->store[$name] = $value; } } $foo = new Foo; $foo->hello = 'hello'; var_dump($foo->hello); var_dump(isset($foo->hello)); // According to the RFC, this would currently return "true", which is not the case. var_dump($foo->world); var_dump(isset($foo->world)); class User { public function __construct(private string $first, private string $last) {} public string $fullName { get { return $this->first . " " . $this->last; } } } $u = new User('Larry', 'Garfield'); var_dump($u->fullName); var_dump(isset($u->fullName));
Output for rfc.property-hooks
string(5) "hello" bool(false) NULL bool(false) string(14) "Larry Garfield" bool(true)

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:
121.64 ms | 1399 KiB | 8 Q