Stryves Posted April 18, 2009 Share Posted April 18, 2009 Just curious if anyone had any issue's with have 4 && conditions in an IF statement. I've had several fail checks, and I don't know why. If I do 1==1 && 2==2 && 3==3 It will work fine... if I do 1==1 && 2==2 && 3==3 && 4==4 it fails? It's easy to work around, just have if 1==1 then check if 2==2 - 4==4 etc... but wasn't sure if it's known issue? Quote Link to comment https://forums.phpfreaks.com/topic/154596-solved-is-there-a-limit-to-an-if-statment-for-and-conditions/ Share on other sites More sharing options...
popcornplya Posted April 18, 2009 Share Posted April 18, 2009 Just tried it, it works fine <?php if(1==1 && 2==2 && 3==3 && 4==4) { echo "good"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/154596-solved-is-there-a-limit-to-an-if-statment-for-and-conditions/#findComment-812973 Share on other sites More sharing options...
DarkSuperHero Posted April 18, 2009 Share Posted April 18, 2009 like a charm..... also what version of php are you using? ive got 5.2.5. <?php if( 1==1 && 2==2 && 3==3 && 4==4 && 5==5 && 6==6){ echo('hello'); } else{ echo'fuck'; } Quote Link to comment https://forums.phpfreaks.com/topic/154596-solved-is-there-a-limit-to-an-if-statment-for-and-conditions/#findComment-812975 Share on other sites More sharing options...
popcornplya Posted April 18, 2009 Share Posted April 18, 2009 like a charm..... also what version of php are you using? ive got 5.2.5. <?php if( 1==1 && 2==2 && 3==3 && 4==4 && 5==5 && 6==6){ echo('hello'); } else{ echo'fuck'; } I doubt PHP versions has to do with anything, but you never know Quote Link to comment https://forums.phpfreaks.com/topic/154596-solved-is-there-a-limit-to-an-if-statment-for-and-conditions/#findComment-812981 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.