最爱红烧肉

最爱红烧肉

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

  • 财富值4740
  • 威望值30
  • 总积分5730

个人信息

  • 赞了说说
    我认为,程序员是最大的亚健康群体,长期久坐,熬夜,颈椎腰椎,心血管非常容易出问题,考虑以后开一家专门服务IT人士的中医诊所。
  • 2017-09-20 已签到
    连续签到1天,获得了5个金钱
  • 2017-09-18 已签到
    连续签到1天,获得了5个金钱
  • 2017-09-15 已签到
    连续签到4天,获得了20个金钱
  • 赞了回答

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

  • 2017-09-14 已签到
    连续签到3天,获得了15个金钱
  • 2017-09-13 已签到
    连续签到2天,获得了10个金钱
  • 赞了说说
    给我32个赞!
  • 回复了 的说说
    断签了,郁闷!站长求一张补签卡,一张就行!
    给了。
  • 2017-09-12 已签到
    连续签到1天,获得了5个金钱
副总裁 等级规则
5730/10000
资料完整度
30/100
用户活跃度
20/100

Ta的关注

15

Ta的粉丝

11

Ta的访客

95