3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TimePeriod { private $Seconds; // <-- Traditional Property public $Hours { // <-- Guarded Property get() { return $this->Seconds / 3600; } set($x) { $this->Seconds = $x * 3600; } isset() { return isset($this->Seconds); } unset() { unset($this->Seconds); } } } $tp = new TimePeriod(); $tp->Hours = 10;
Output for 5.3.0 - 5.3.21, 5.4.0 - 5.4.11
Parse error: syntax error, unexpected '{', expecting ',' or ';' in j8kYk on line 6
Process exited with code 255.

preferences:
160.24 ms | 1395 KiB | 41 Q