When the echo statement contains strings, string operators, variables, and arithmetic operators, why can't you perform arithmetic operations instead of directly outputting the last variables and strings?

$a=10;
$b=60;
echo "$a*$b=".$a*$b."<br>";  //$a*$b=600<br>
echo "$a/$b=".$a/$b."<br>";  //$a/$b=0.16666666666667<br>
echo "$a+$b=".$a+$b."<br>";  //60<br>
echo "$a-$b=".$b+$a."<br>";  //10<br>

can output the last variable and string without reporting an error. What is the reason for this?

Php
Mar.11,2021

Note the difference between''and "'.
''does not parse variables,"parse variables
echo' $apropriated variables.
'
'in
'$apropriated variables' this is a string, so let's output

as a string.

there will be a waring error in the last two outputs, indicating that A non-numeric value encountered said $a + has a problem


because the operator precedence is different
* /% is higher than . , so first calculate * /%
+ -. sibling, so operate from left to right

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3d9d3-2b8f4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3d9d3-2b8f4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?