3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class Foo { public function __set(string $name, int $value): void { $this->{$name} = $value; } public function __get(string $name): int { return $this->{$name}; } } $o = new Foo; $o->x = '3'; var_dump($o->x);

preferences:
55.75 ms | 402 KiB | 5 Q