- Output for 8.2.0 - 8.2.27, 8.3.0 - 8.3.15, 8.4.1 - 8.4.2
- false true
<?php
class Dog {
public function __construct(protected bool $woof){}
public function __isset(string $name) {
if ($name === 'woof') {
return $this->woof;
}
return FALSE;
}
public function __get(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));