Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compound "if" question

Status
Not open for further replies.

koala15

Programmer
May 9, 2001
322
AU
Hi all,

As an example, I have a statement like

[blue]if (is_array($var1)) && (count($var1) > 3) && ($var1[2] == 22 ) {...}[/blue]

Question: in visual basic, the compilation order of each section of the "if" construct is not guaranteed and as a result (in VB) if $var1 was not an array the compiler could generate and error on the statement "($var1[2] == 22)" because that construct is only applicable to arrays?

Does anyone know what happens in PHP?

Thanks ... Greg

Footnote: For the purposes of this question, please assume that the VB and PHP "if" constructs are the same. Also, I realise that I could split the above "if" statement into a three separate statements that would always compile correctly - I just want to understand what happens within the compile process of PHP. Thanks.

"Life is full of learning, and then there is wisdom"
 
Wouldn't it be easier to run it and see for yourself rather than asking us to run it and tell you?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top