note 68196 deleted from language.operators.comparison by danbrown
| From: | danbrown@php.net | Date: | Thu, 18 Jun 2009 14:07:33 +0000 |
| Subject: | note 68196 deleted from language.operators.comparison by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-157072@lists.php.net to get a copy of this message | ||
Note Submitter: gamephreak AT removethis gmail DOT com
----
"Identical to" is faster compared to "equals to." I ran a test script that
compared various combinations of strings and integers over a 10000x loop. Sample results:
'foo' v. 'foo' eq: 0.00274
'foo' v. 'foo' id: 0.001671
42 v. 42 eq: 0.00171
42 v. 42 id: 0.001436
'foo' v. 'bar' eq: 0.002589
'foo' v. 'bar' id: 0.001658
42 v. 43 eq: 0.001719
42 v. 43 id: 0.001419
'42' v. 42 eq: 0.00223
'42' v. 42 id: 0.001392
'42' v. 43 eq: 0.002281
'42' v. 43 id: 0.001389