>백엔드 개발 >PHP 튜토리얼 >Strict standards: Non-static method cls_image::gd_version()_PHP教程

Strict standards: Non-static method cls_image::gd_version()_PHP教程

WBOY
WBOY원래의
2016-07-15 13:21:401093검색

Strict standards: Non-static method cls_image::gd_version() should not be called statically in E:\SiteAll\zbphp.com\www\includes\lib_base.php on line346

 
 
 
 
这个错误的的处理是修改文件:E:\SiteAll\ZBPHP.COM\www\includes\cls_image.php 第693行,把
 
“function gd_version()” 改成“static function gd_version()” 即可。
 
 
发现最新版本的PHP(PHP/5.4.16),有很多兼容问题,总是有报错。其实原因是最新版的更严格。
 
发现有几个地方:
 
1)类的静态方法,前面必须有static修饰。不能直接写public function fName(),前面必须加上static,否则报错
 
2)类的继承extends,子类的方法,如果父类也有,那么必须参数一致,否则也会报错。Strict standards: Declaration of UrlPath::Goods() should be compatible with UrlBase::Goods($rs, $param = Array) in
 
 
 
补充:Strict standards: Only variables should be passed by reference in E:\SiteAll\ZBPHP.COM\www\includes\cls_template.php on line 418
 
将 $tag_sel = array_shift(explode(' ', $tag)); 修改为 
 
 
<span style="font-size:18px;">            $tag_sel = explode(&#39; &#39;, $tag);  
            $tag_sel = array_shift($tag_sel);</span>  

 


www.bkjia.comtruehttp://www.bkjia.com/PHPjc/477146.htmlTechArticleStrict standards: Non-static method cls_image::gd_version() should not be called statically in E:\SiteAll\zbphp.com\www\includes\lib_base.php on line346 这个错误的的处理是修...
성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.