Variable operations are divided according to the return value type:
1. Arithmetic operations: return numeric type (integet/float);
2. Logical operations: return Boolean type (true /false);
3. Character operation: Return string type (string);
Memory points: The return types are all scalars, four basic types.
var_dump(5+10); //返回integer; echo '<hr>'; var_dump(3.14*5*5); //返回float; echo '<hr>'; var_dump(100>90); //返回布尔型bool的true echo '<hr>'; //&&:如果第一个表达式计算结果为false,整个结果就是false,后面就不会再计算了 var_dump(100>90 && 30 >= 50); //'与'返回false echo '<hr>'; //||:二个表达式都会被计算 var_dump(100>90 || 30 >= 50); //'或'返回false echo '<hr>'; $siteName = 'PHP中文网'; $course = 'php编程技术'; echo '欢迎来到'.$siteName.'学习'.$course; //字符串连接,返回一个新字符串