Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

note 73559 added to language.control-structures

0 views
Skip to first unread message

mongo...@gmail.com

unread,
Mar 1, 2007, 9:03:31 AM3/1/07
to php-...@lists.php.net
@simplyduh

>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 :)

I read dougnoel's post. He was providing an example of a BAD example. The last line in his post suggests that you NOT check for both - only the admin. So actually what he meant to check for is whether or not they are an admin. If so then they automatically have delete permissions - therefore it may be possible that no variable named "$has_delete_permissions" exists. The resulting statement would be as follows:

if($is_admin)
{
//Statements to delete stuff go here.
}
----
Server IP: 216.194.113.175
Probable Submitter: 72.15.123.32
----
Manual Page -- http://www.php.net/manual/en/language.control-structures.php
Edit -- https://master.php.net/note/edit/73559
Del: integrated -- https://master.php.net/note/delete/73559/integrated
Del: useless -- https://master.php.net/note/delete/73559/useless
Del: bad code -- https://master.php.net/note/delete/73559/bad+code
Del: spam -- https://master.php.net/note/delete/73559/spam
Del: non-english -- https://master.php.net/note/delete/73559/non-english
Del: in docs -- https://master.php.net/note/delete/73559/in+docs
Del: other reasons-- https://master.php.net/note/delete/73559
Reject -- https://master.php.net/note/reject/73559
Search -- https://master.php.net/manage/user-notes.php

m...@php.net

unread,
Aug 28, 2008, 10:56:38 AM8/28/08
to php-...@lists.php.net
Note Submitter: mongoose643 at gmail dot com

----

0 new messages