note 101202 added to function.gettype
| From: | Anonymous at osu1 dot php dot net | Date: | Thu, 02 Dec 2010 07:28:11 +0000 |
| Subject: | note 101202 added to function.gettype | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-174548@lists.php.net to get a copy of this message | ||
@PPKu-N0-SPAM-schy at mediasoft-berlin dot de:
The slow warning is only for single function calls like
gettype() == 'string'
vs. is_string().
Testing your function on 1.000.000 iterations vs. gettype your function was faster when checking
NULL because is_null() is the first check (1.3 vs. 1.5) , but slower when checking strings (2.9 vs.
1.5) and even worse when checking object (3.6 vs. 1.5) because that is almost the last check and it
has to run 8x an is_type() function to get to the is_object().
----
Server IP: 212.124.37.9
Probable Submitter: 84.63.167.23
----
Manual Page -- http://www.php.net/manual/en/function.gettype.php
Edit -- https://master.php.net/note/edit/101202
Del: integrated -- https://master.php.net/note/delete/101202/integrated
Del: useless -- https://master.php.net/note/delete/101202/useless
Del: bad code -- https://master.php.net/note/delete/101202/bad+code
Del: spam -- https://master.php.net/note/delete/101202/spam
Del: non-english -- https://master.php.net/note/delete/101202/non-english
Del: in docs -- https://master.php.net/note/delete/101202/in+docs
Del: other reasons-- https://master.php.net/note/delete/101202
Reject -- https://master.php.net/note/reject/101202
Search -- https://master.php.net/manage/user-notes.php