- Kill the whole app in case of an error
- Return error code and/or message
<?php
function writeToFile( $file, $content )
{
if ( ( $f = fopen( $file, "w" ) ) === false )
{
exit( "Could not write to <$file>" );
}
// ...
}
writeToFile(
"/tmp/foo",
"99 klingons on a killing crusade"
);
?>