note 70933 added to language.control-structures
| From: | simplyduh at osu1 dot php dot net | Date: | Sat, 04 Nov 2006 21:33:12 +0000 |
| Subject: | note 70933 added to language.control-structures | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-119397@lists.php.net to get a copy of this message | ||
dougnoel, you are wrong recarding optimization:
> if ($is_admin && $has_delete_permissions)
> If only an admin can have those permissions, there's no
> need to check for the permissions if the user is not an admin.
Duh, both are booleans in the above case, and its obvious that
checking one boolean is better than checking 2.
if ($has_delete_permissions) would work better :)
----
Server IP: 64.71.164.2
Probable Submitter: 66.120.11.178
----
Manual Page -- http://www.php.net/manual/en/language.control-structures.php
Edit -- https://master.php.net/note/edit/70933
Del: integrated -- https://master.php.net/note/delete/70933/integrated
Del: useless -- https://master.php.net/note/delete/70933/useless
Del: bad code -- https://master.php.net/note/delete/70933/bad+code
Del: spam -- https://master.php.net/note/delete/70933/spam
Del: non-english -- https://master.php.net/note/delete/70933/non-english
Del: in docs -- https://master.php.net/note/delete/70933/in+docs
Del: other reasons-- https://master.php.net/note/delete/70933
Reject -- https://master.php.net/note/reject/70933
Search -- https://master.php.net/manage/user-notes.php