note 77937 deleted from language.types.null by googleguy
| From: | googleguy@php.net | Date: | Sun, 03 Mar 2013 00:00:39 +0000 |
| Subject: | note 77937 deleted from language.types.null by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-193779@lists.php.net to get a copy of this message | ||
Note Submitter: james
----
A little speed test:
<?php
$v = NULL;
$s = microtime(TRUE);
for($i=0; $i<1000; $i++) {
is_null($v);
}
print microtime(TRUE)-$s;
print "<br>";
$s = microtime(TRUE);
for($i=0; $i<1000; $i++) {
$v===NULL;
}
print microtime(TRUE)-$s;
?>
Results:
0.017982006072998
0.0005950927734375
Using "===" is 30x quicker than is_null().