+ 1
if php supports bitwise and turnory operator????
and also increment and detriment???
1 Réponse
+ 1
Yes PHP do support bitwise and ternary operators.
<?php
echo ( 2 | 1 ) . "\n"; // should be 3 (10) | (01) = (11)
echo ( 2 & 1 ) . "\n"; // should be 0 (10) & (01) = (00)
echo ( 2 ^ 1 ) . "\n"; // should be 3 (10) ^ (01) = (11)
echo 1==1 ? "TRUE\n" : "FALSE\n";
echo 1!=1 ? "TRUE\n" : "FALSE\n";
?>
//output
/*
3
0
3
TRUE
FALSE
*/