note 60460 deleted from function.empty by tularis
| From: | tularis@php.net | Date: | Sat, 07 Jan 2006 23:38:09 +0000 |
| Subject: | note 60460 deleted from function.empty by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-101373@lists.php.net to get a copy of this message | ||
Note Submitter: denis at licejus dot lt
Reason: useless
----
Many people use
<?php
if ($variable) {
// do stuff
}
?>
This is not good and creates E_NOTICE. You have to turn error_reporting to strict
(error_reporting(E_STRICT)) too see it.
Instead, always use
<?php
if (!empty($variable)) {
// do stuff
}
?>
which adds code readability, makes it more compatible and removes notice.