<?php
echo $m1 = memory_get_usage();
echo "<br />";
"$var_string="123";"
echo $m2 = memory_get_usage()-$m1;
echo "<br />";
"$n=123;"
echo $m3 = memory_get_usage()-$m1-$m2;
echo "<br />";
"$f=123.00;"
echo $m4 = memory_get_usage()-$m1-$m2-$m3;
echo "<br />";
"$var_array= array("123");"
echo $m5 = memory_get_usage()-$m1-$m2-$m3-$m4;
?>
不是第四行报错,7,10,13那几行都错了,要把外层的引号删掉。任务栏上面有两个引号,是因为外层的那个引号的作用是对要增加的内容的一个说明标注,不是让在代码上写的内容。内层的引号才是字符串的引号
<?php
echo $m1 = memory_get_usage();
echo "<br />";
$var_string="123"; //字符串类型“123”
echo $m2 = memory_get_usage()-$m1;
echo "<br />";
$n=123;//整型
echo $m3 = memory_get_usage()-$m1-$m2;
echo "<br />";
$f=123.00;//浮点型
echo $m4 = memory_get_usage()-$m1-$m2-$m3;
echo "<br />";
$var_array=array("123");//数组
echo $m5 = memory_get_usage()-$m1-$m2-$m3-$m4;
?>
$var_string="123";
再在外围加一个双引号干什么呢