o__荒年
- o__荒年 2018-04-19 已签到连续签到2天,获得了10个金钱
- o__荒年 收藏了话题Yii2.0页面提示消息
- o__荒年 2018-04-18 已签到连续签到1天,获得了5个金钱
- o__荒年 赞了回答
也发现了这个问题,追了源码:
在ErrorHandler类里,有这个变量:
/*** @var integer the size of the reserved memory. A portion of memory is pre-allocated so that * when an out-of-memory issue occurs, the error handler is able to handle the error with * the help of this reserved memory. If you set this value to be 0, no memory will be reserved. * Defaults to 256KB.
*/
public $memoryReserveSize = 262144;/** * Register this error handler */ public function register() { ini_set('display_errors', false); set_exception_handler([$this, 'handleException']); if (defined('HHVM_VERSION')) { set_error_handler([$this, 'handleHhvmError']); } else { set_error_handler([$this, 'handleError']); } if ($this->memoryReserveSize > 0) { $this->_memoryReserve = str_repeat('x', $this->memoryReserveSize); } register_shutdown_function([$this, 'handleFatalError']); }
因为php没有用户主动分配内存的机制,所以,为了内存溢出也能抛出错误,预留了26w个x预先占用了内存。。。
是不是很冷,哈哈 - o__荒年 2018-04-04 已签到连续签到3天,获得了15个金钱
- o__荒年 2018-04-03 已签到连续签到2天,获得了10个金钱
- o__荒年 2018-04-02 已签到连续签到1天,获得了5个金钱
- o__荒年 2018-03-28 已签到连续签到1天,获得了5个金钱