- var_dump: documentation ( source)
<?php
class AbilityScore
{
public $value;
public function __construct(int $value)
{
if ($value < 1)
throw new AbilityScoreTooLowException('Ability Score should be at least 1');
$this->value = $value;
}
public function __set($field, $value)
{
throw new Exception('Not here mate!');
}
}
$test = new AbilityScore(10);
$test->value = 11;
var_dump($test);
$test->buuu = 'asdsada';
var_dump($test);