o__荒年

o__荒年

这家伙有点懒,还没写个性签名!

  • 财富值2395
  • 威望值40
  • 总积分3115

个人信息

  • 2018-04-19 已签到
    连续签到2天,获得了10个金钱
  • 收藏了话题
    Yii2.0页面提示消息
  • 2018-04-18 已签到
    连续签到1天,获得了5个金钱
  • 赞了回答

    也发现了这个问题,追了源码:
    在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预先占用了内存。。。
    是不是很冷,哈哈

  • 2018-04-04 已签到
    连续签到3天,获得了15个金钱
  • 2018-04-03 已签到
    连续签到2天,获得了10个金钱
  • 2018-04-02 已签到
    连续签到1天,获得了5个金钱
  • 2018-03-28 已签到
    连续签到1天,获得了5个金钱
总监 等级规则
3115/5000
资料完整度
30/100
用户活跃度
0/100

Ta的关注

3

Ta的粉丝

6

Ta的访客

46