3v4l.org

run code in 500+ 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 8.3.5
Parse error: syntax error, unexpected token "{", expecting "," or ";" in /in/2Arkh on line 26
Process exited with code 255.

preferences:
47.95 ms | 493 KiB | 3 Q