- Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.16, 7.0.0 - 7.0.1
- Parse error: syntax error, unexpected '__construct' (T_STRING), expecting variable (T_VARIABLE) in /in/XrW5d on line 6
Process exited with code 255.
<?php
class AbilityScore
{
public $value;
public __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;
$test->buuu = 'asdsada';