慕运维2326190
2018-10-05 18:55
<?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;
?>
感谢大佬
不要双引号!!!!!!!!!!!!
赋值时,不需要在最外面加双引号,最后的数组赋值,括号用半角的。
<?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;
?>
这样就可以了
PHP入门篇
455994 学习 · 6306 问题
相似问题