Skip to content

Instantly share code, notes, and snippets.

@mcsee
Last active April 20, 2024 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcsee/75cb385ad949635913e898aa6a030b95 to your computer and use it in GitHub Desktop.
Save mcsee/75cb385ad949635913e898aa6a030b95 to your computer and use it in GitHub Desktop.
<?
$sourceFile = 'C:\temp\source.txt';
$destination = 'C:\temp\destination :txt';
// The filename is simplified
// and might come from a programmatic construction
$copyWasSuccessful = copy($sourceFile, $destination);
if (!$copyWasSuccessful || !$file_exists($destination)) {
// Don't trust the function result. Handle the postcondition error
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment