3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class Thing { private string $state; public function __construct() { $this->state = 'foo'; } public function __set(string $property, $value) : void { $this->$property = $value; } } var_dump(new Thing());

preferences:
29.34 ms | 404 KiB | 5 Q