3v4l.org

run code in 500+ PHP versions simultaneously
<?php public function set (string $property, mixed $value): void { $this->$property = $value; } public function get (string $property): mixed { return $this->$property; }
Output for 8.1.0 - 8.1.26, 8.2.0 - 8.2.13, 8.3.0 - 8.3.5
Parse error: syntax error, unexpected token "public", expecting end of file in /in/ZmK3K on line 3
Process exited with code 255.

preferences:
47.54 ms | 669 KiB | 3 Q