- var_dump: documentation ( source)
<?php
class CoalesceTest
{
public function __isset(string $key): bool
{
return false;
}
public function __get(string $key): mixed
{
throw new \Exception();
}
}
$test = new CoalesceTest();
var_dump($test->bar ?? 'fallback');