<?php class Dog { public function __construct(protected bool $woof){} public function __isset(string $name) { if ($name === 'woof') { return $this->woof; } return FALSE; } } $f = new Dog(TRUE); var_export(empty($f->woof)); echo PHP_EOL; var_export(isset($f->woof));
You have javascript disabled. You will not be able to edit any code.