3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Math { public int $x; public int $y; public function __construct($x, $y) { $this->x = $x; $this->y = $y; } public function add() { return $this->x + $this->y; } public function __set($key, $val) { $this->x = $val; } } $math = new Math(5,10); unset($math->x); echo $math->add();

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
191.44 ms | 2222 KiB | 10 Q