功能很好.
我看到功能徽标()比$logo更好. echo不占用太多内存,但$logo确实如此.即使函数logo()需要一些东西,它也将由PHP自己的垃圾收集器处理.您还可以使用这些函数来确保不会滥用分配的内存.
> memory_get_peak_usage();
> memory_get_usage();
说明:
Upon the ending of an in use function PHP clears the memory it was using, at least more efficiently than if not using a function. If you are using recursive code or something similar that is memory intensive try putting the code into a function or method, upon closing of the function/method the memory used for the function will be garbaged much more efficiently than that of unsetting variables within the loop itself.