componere icon indicating copy to clipboard operation
componere copied to clipboard

Componere\Value::([ $default ] ) If the argument is an array, an error will be reported

Open lichihua opened this issue 4 years ago • 0 comments

$DefClass = new \Componere\Definition( 'Teacher');

$DefClass->addProperty('name',new Componere\Value('tom'));
$DefClass->addProperty('age',new Componere\Value(20));
$DefClass->addProperty('like',new Componere\Value(['play','sleep']));

$DefClass->register();


$people=new Teacher();
echo $people->name;
echo $people->age;
var_dump($people);

//Fatal error: Uncaught InvalidArgumentException: values of type array cannot be declared with default values in

lichihua avatar Mar 27 '20 01:03 lichihua