<?php
class Le {
}
class Chuck {
function __construct(Le $object = null){
var_dump($object);
}
}
class Chuck2 {
function __construct(Le $object){
var_dump($object);
}
}
new Chuck(null);
new Chuck2(null);
NULL
Fatal error: Uncaught TypeError: Chuck2::__construct(): Argument #1 ($object) must be of type Le, null given, called in /in/GWtuW on line 18 and defined in /in/GWtuW:12
Stack trace:
#0 /in/GWtuW(18): Chuck2->__construct(NULL)
#1 {main}
thrown in /in/GWtuW on line 12
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
NULL
Fatal error: Uncaught TypeError: Chuck2::__construct(): Argument #1 ($object) must be of type Le, null given, called in /in/GWtuW on line 18 and defined in /in/GWtuW:12
Stack trace:
#0 /in/GWtuW(18): Chuck2->__construct(NULL)
#1 {main}
thrown in /in/GWtuW on line 12
Process exited with code 255.
NULL
Fatal error: Uncaught TypeError: Argument 1 passed to Chuck2::__construct() must be an instance of Le, null given, called in /in/GWtuW on line 18 and defined in /in/GWtuW:12
Stack trace:
#0 /in/GWtuW(18): Chuck2->__construct(NULL)
#1 {main}
thrown in /in/GWtuW on line 12
Process exited with code 255.
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.21
NULL
Catchable fatal error: Argument 1 passed to Chuck2::__construct() must be an instance of Le, null given, called in /in/GWtuW on line 18 and defined in /in/GWtuW on line 12
Process exited with code 255.