Note, that this method accepts _everything_ (=> returns 'true'), when $executable is 'false' as long as the filename contains at least a dot
var_dump(\PharData::isValidPharFilename('randomstring.y', false));
bool(true)
This is not wrong at all, because I can name an archive like I want, but it makes the method completely useless (when $executable == false).