php Yii: 出现undefined offset 或者 undefined index解决方案

在开发Yii 时,在程序中定义了以下方式:php

       if($this->menuoption[2] === 'test'),那么在运行程序时会报:undefined offset:2,这样的错误主要是因为php.ini 里的错误等级过高了,在windows下错误等级是:error_reporting =  E_ALL & ~E_NOTICE,这样就不会报错。而在Ubuntu系统里面,按照完php5以后,在/etc/php5/apache2/php.ini文件中定义的error_reporting值为:E_ALL & ~E_DEPRECATED。apache

      要解决此问题须要将error_reporting值设置为:E_ALL & ~E_NOTICE。windows

相关文章
相关标签/搜索