1. 在使用Laravel时,遇到这么一个问题 Fatal error: Maximum function nesting level of '100' reached, aborting!, 由于平时几乎没遇过这个问题,所以一直以为是程序本身存在问题. 但代码每一次都是到了:\vendor\symfony\http-foundation\ParameterBag.php则终止了,可这一段代码怎么看也不可能存在问题呀。

    /**
    * Returns a parameter by name.
    *
    * @param string $key     The key
    * @param mixed  $default The default value if the parameter key does not exist
    *
    * @return mixed
    */
    public function get($key, $default = null)
    {
    return array_key_exists($key, $this->parameters) ? $this->parameters[$key] : $default;
    }
    

    最后还是网上找到了,原因就是启用了xdebug,而xdebug默认设置了函数最大嵌套数为100 解决办法: 找到php.ini文件,找到xdebug 在最后加上xdebug.max_nesting_level =500 (这个数最好大于100即可)

  2. htmlspecialchars 中文空白。
    htmlspecialchars 5.4及以后使用默认编码为UTF-8,而此前使用为ISO-8859-1编码,如果程序出错,可使用:

    htmlspecialchars($str,ENT_COMPAT,'ISO-8859-1');
    

    进行修正

  3. PHP中错误日志display_errors与error_reporting配置 http://www.cnblogs.com/usa007lhy/p/5427970.html

  4. yield http://www.laruence.com/2015/05/28/3038.html https://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fac9270762a000/0013868328689835ecd883d910145dfa8227b539725e5ed000