componere
componere copied to clipboard
Componere\Value::([ $default ] ) If the argument is an array, an error will be reported
$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