PHP中的unset的使用问题
1. < ?php 2. $test=str_repeat(“1″,256); //重复一个字符串,返回值为重复后组成的字符串3. $s = memory_get_usage();
4. //该函数用来查看当前所用内存
5. unset($test);
6. $e = memory_get_usage();
7. echo ‘ 释放内存: ‘.($s-$e);
8. //输出为272,但如果上面test变量改为$test=str_repeat(“1″,255),输出则为0 ,变量值不足256不会释放内存的
9. ?>
页:
[1]