note 79780 deleted from function.empty by cmb
| From: | cmb@php.net | Date: | Fri, 26 Apr 2019 16:54:57 +0000 |
| Subject: | note 79780 deleted from function.empty by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-210680@lists.php.net to get a copy of this message | ||
Note Submitter: MaD HamsteR
----
SAME RESULT! But somehow using empty() function is faster for about 10-13%
<?php
$array[] = "";
$array[] = '';
$array[] = 0;
$array[] = "0";
$array[] = NULL;
$array[] = false;
$array[] = array();
$array[] = $var;
foreach($array as $value){
echo (!empty($value))? 'Not empty!' : 'Empty!';
echo '<br />'."\r\n";
}
echo '<br />'."\r\n";
foreach($array as $value){
echo ($value)? 'Not empty!' : 'Empty!';
echo '<br />'."\r\n";
}
?>