我试图比较内存中使用的常量和变量,但发现了一个奇怪的现象。
测试代码:
<?php
var_dump( memory_get_usage() ); // int(129100)
// I don't understand: I don't do someting but why there has the changed
var_dump( memory_get_usage() ); // int(129156)
var_dump( memory_get_usage() ); // int(129156)
define('hello', 'WORLD');
// why here hasn't changed
var_dump( memory_get_usage() ); // int(129156)
$hello = 'WORLD';
var_dump( memory_get_usage() ); // int(129304)
?>