Fatal error: Uncaught ArgumentCountError: Too few arguments to function Human::__construct(), 1 passed and exactly 2 expected in /in/COnUL:6
Stack trace:
#0 [internal function]: Human->__construct(Array)
#1 /in/COnUL(19): ReflectionClass->newInstance(Array)
#2 {main}
thrown in /in/COnUL on line 6
Process exited with code 255.
Warning: Missing argument 2 for Human::__construct() in /in/COnUL on line 6
Notice: Undefined variable: age in /in/COnUL on line 9
Warning: Missing argument 2 for Human::__construct() in /in/COnUL on line 6
Notice: Undefined variable: age in /in/COnUL on line 9
Warning: Missing argument 2 for Human::__construct() in /in/COnUL on line 6
Notice: Undefined variable: age in /in/COnUL on line 9
array(3) {
[0]=>
object(Human)#2 (2) {
["name":"Human":private]=>
array(2) {
[0]=>
string(4) "John"
[1]=>
int(23)
}
["age":"Human":private]=>
NULL
}
[1]=>
object(Human)#1 (2) {
["name":"Human":private]=>
array(2) {
[0]=>
string(4) "Nick"
[1]=>
int(32)
}
["age":"Human":private]=>
NULL
}
[2]=>
object(Human)#3 (2) {
["name":"Human":private]=>
array(2) {
[0]=>
string(3) "Ann"
[1]=>
int(17)
}
["age":"Human":private]=>
NULL
}
}