object(User)#1 (2) {
["id"]=>
int(1)
["age"]=>
object(ValidAge)#2 (1) {
["age"]=>
int(33)
}
}
Fatal error: Uncaught TypeError: User::__construct(): Argument #2 ($age) must be of type ValidAge, NotValidAge given, called in /in/WksJS on line 46 and defined in /in/WksJS:34
Stack trace:
#0 /in/WksJS(46): User->__construct(1, Object(NotValidAge))
#1 {main}
thrown in /in/WksJS on line 34
Process exited with code 255.
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15)
/bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15)
/bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
object(User)#1 (2) {
["id"]=>
int(1)
["age"]=>
object(ValidAge)#2 (1) {
["age"]=>
int(33)
}
}
Fatal error: Uncaught TypeError: User::__construct(): Argument #2 ($age) must be of type ValidAge, NotValidAge given, called in /in/WksJS on line 46 and defined in /in/WksJS:32
Stack trace:
#0 /in/WksJS(46): User->__construct(1, Object(NotValidAge))
#1 {main}
thrown in /in/WksJS on line 32
Process exited with code 255.
Output for 8.1.30 - 8.1.33
Parse error: syntax error, unexpected token "readonly", expecting end of file in /in/WksJS on line 3
Process exited with code 255.