stream_is_local

Supported Versions: PHP 5 >= 5.2.4, PHP 7, PHP 8
Checks if a stream is a local stream
<?php stream_is_local(resource|string $stream): bool
<?php     public function copy(string $originFile, string $targetFile, bool $overwriteNewerFiles = false)

    {

        $originIsLocal = stream_is_local($originFile) || 0 === stripos($originFile, 'file://');

        if ($originIsLocal && !is_file($originFile)) {

            throw new FileNotFoundException(sprintf('Failed to copy "%s" because file does not exist.', $originFile), 0, null, $originFile);

        }