note 96469 added to control-structures.elseif
| From: | ilearned_itglobal at ymaildotcom | Date: | Mon, 01 Mar 2010 05:03:24 +0000 |
| Subject: | note 96469 added to control-structures.elseif | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-166457@lists.php.net to get a copy of this message | ||
I recently ran into a block of code that had a else if statement in an unusual way. I was looking at
the code and notice that the if statement was nested inside a else statement later in the code
without the else being closed off. I haven't parse this code to see if it was correct. I just
need to know if anybody else ran into the same problem and what's the best way to parse it
correctly.
The code itself has a lot of security measures for a user
Here is the example:
function user(){
if ($a){
do something
if ($b){
do something
if ($c){
do something
} else {
do something else
if ($e){ //nested inside a else statement
do something
} else {
do something else
}
}
} else {
do something else
}
} else {
do something else
}
}
I'm not a pro (yet) but is there something wrong with this or is there a better way to parse
this
----
Server IP: 78.110.173.36
Probable Submitter: 32.134.204.38
----
Manual Page -- http://www.php.net/manual/en/control-structures.elseif.php
Edit -- https://master.php.net/note/edit/96469
Del: integrated -- https://master.php.net/note/delete/96469/integrated
Del: useless -- https://master.php.net/note/delete/96469/useless
Del: bad code -- https://master.php.net/note/delete/96469/bad+code
Del: spam -- https://master.php.net/note/delete/96469/spam
Del: non-english -- https://master.php.net/note/delete/96469/non-english
Del: in docs -- https://master.php.net/note/delete/96469/in+docs
Del: other reasons-- https://master.php.net/note/delete/96469
Reject -- https://master.php.net/note/reject/96469
Search -- https://master.php.net/manage/user-notes.php