+ 5

Whats is different between "and" & "&&" ?

16th Sep 2017, 6:15 AM
Chandan Kumar Gouda
Chandan Kumar Gouda - avatar
5 Réponses
+ 6
$a=true; $b=false; $t=$a||$b; echo $t; and $a=true; $b=false; $t=$a or $b; echo $t; $t=$a or $b equal to >> ($t=$a) or $b while other one $t=$a||$b equal to >> $t=($a or $b) (I prefer to example || bc && is too hard to make example for me)
16th Sep 2017, 6:21 AM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 4
@Very_Hard(java & c++ & c# & py & rust & (AllHard)) This is only for php, right? As in C++, the definition for 'and' in Code::Blocks is like this : #define and && I don't think this leads to change in operator precedence... And in many compilers, the written version of 'and' does not even exist...
16th Sep 2017, 9:36 AM
Kinshuk Vasisht
Kinshuk Vasisht - avatar
+ 4
@Kinshuk Vasisht I think so.and operator(not &&) is in php but He tagged all language that make myself my mom my father my aunt my uncle my grandma and even my doll very cofused
16th Sep 2017, 9:40 AM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 4
@Chandan Kumar Gouda Please tag your question correctly. No one can understand which language you need an answer for. After all, In C++, there is no specific 'and' keyword, just &&, as an operator.
16th Sep 2017, 9:57 AM
Kinshuk Vasisht
Kinshuk Vasisht - avatar
+ 3
Wow I thought they were all the same!
16th Sep 2017, 6:48 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar