- unlink: documentation ( source)
- is_file: documentation ( source)
<?php
declare(strict_types=1);
function bad_3rd_partycode( $p ) {
return null;
}
function my_code( string $path ): string {
if ( is_file( $path ) ) {
unlink( $path );
}
return '';
}
$value = 'foo.log';
$value = call_user_func( 'bad_3rd_partycode', $value );
echo call_user_func( 'my_code', $value );