- fopen: documentation ( source)
<?php
function func(string $foo){
}
try {
func(null);
} catch (Error $e){
echo $e->getMessage()."\n";
}
try {
func(array());
} catch (Error $e){
echo $e->getMessage()."\n";
}
try {
func((object)array());
} catch (Error $e){
echo $e->getMessage()."\n";
}
try {
func(fopen("php://stdout", "w"));
} catch (Error $e){
echo $e->getMessage()."\n";
}