note 60286 deleted from function.fwrite by bjori
| From: | bjori@php.net | Date: | Wed, 22 Mar 2006 17:48:52 +0000 |
| Subject: | note 60286 deleted from function.fwrite by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-106281@lists.php.net to get a copy of this message | ||
Note Submitter: wizdkid at wizdkid dot com
----
> In PHP 4.3.7 fwrite returns 0 rather than false on
> failure.
Actually it can return any of these:
-NULL,
-0,
-FALSE
This means instead of writing the example shown:
<?php
if (fwrite($handle, $somecontent) === FALSE) { //code
}
?>
You could write something shorter like:
<?php
if ( !fwrite($handle, $somecontent) ) { //code
}
?>
It is a better coding to define the ! (is not) before the arguments. But both work fine.