<?php class ValidationFailedException extends Exception {} class Yoba { private int $age; public function getAge () : int { return $this->age; } public function setAge (int $age) : void { $this->age = $age; $this->ageValidate(); } public function ageValidate () : bool { if (($this->age > 0) && ($this->age <= 100)) { return true; } throw new ValidationFailedException(); } } $yo = new Yoba(); $yo->setAge(10); echo $yo->getAge(); $yo->setAge(1000); echo $yo->getAge();
You have javascript disabled. You will not be able to edit any code.
Value for `_results` contains invalid data `array`