使用php报了这个错误:

错误的意思是:  严格标准: usermodel中的 toJSON() 方法 应该 同 BaseModel中的toJson() 方法是兼容的.

php要求 子类的方法如果同父类相同的话, 那么 子类重写的方法的参数应该同父类中的一致.

--------------

其中BaseModel是 父类:

UserModel中:

------------------

解决方案一:

将子类中的 同名的方法中的参数同父类一致:

解决方法二:

将php.ini 中 error_reporting 的级别中 去除E_STRICT 级别

上图将  E_ALL | E_STRICT (所有级别的错误) 改为  下面的 xampp中的默认的错误级别,就可以了.

实际上, 之所以 出现错误 就是因为 公司的开发机 使用的 是 xampp .  而我私人的机器上的错误级别是 E_ALL | E_STRICT

Strict Standards: Declaration of UserModel::toJSON() should be compatible with that of BaseModel::toJSON()的更多相关文章

  1. php 错误 Strict Standards: PHP Strict Standards: Declaration of .... should be compatible with that of 解决办法

    错误原因:这是由于 php 5.3版本后.要求继承类必须在父类之后定义.否则就会出现Strict Standards: PHP Strict Standards: Declaration of ... ...

  2. PHP Strict standards:Declaration of … should be compatible with that of…(转)

    今天把原来一份很老的PHP代码导入到了PaaS上,出现了许多Strict standards:Declaration of … should be compatible with that of…这样 ...

  3. PHP中Strict Standards错误解决方法二

    在PHP5.3.3 中安装wordpress 3.0.1 ,在安装时出现错误:Strict Standards: PHP Strict Standards: Declaration of Walker ...

  4. PHP Strict Standards:问题解决

    异常信息: ( ! ) Strict standards: Declaration of SugarEmailAddress::save() should be compatible with tha ...

  5. 安装ECMall后报PHP Strict Standards错误,请问如何解决

    Strict Standards: Non-static method ECMall::startup() should not be called statically in /htdocs/ecm ...

  6. 已解决:Strict Standards: Only variables should be passed by reference in

    今天安装ecshop的时候最上面出现了一个错误提示:Strict Standards: Only variables should be passed by reference in F:\www.x ...

  7. 已解决:Strict Standards: Non-static method cls_image::gd_version() should not be called statically in...

    在安装Ecshop的时候,遇到两个⚠️问题: Strict Standards: Non-static method cls_image::gd_version() should not be cal ...

  8. Strict Standards: Only variables should be passed by reference

    <?php $tag="1 2 3 4 5 6 7"; $tag_sel = array_shift(explode(' ', $tag)); print_r($tag_se ...

  9. ECShop出现Strict Standards: Only variables should be passed by reference in的解决方法

    今天安装ecshop的时候最上面出现了一个错误提示:Strict Standards: Only variables should be passed by reference in F:\www.x ...

随机推荐

  1. Python特点

    用一种方法,最好只用一种方法来做一件事 1.面向对象(解决一个问题,先考虑由“谁”来做,怎么做是“谁”的职责) 函数.模块.数字.字符串都是对象 在Python中一切皆对象 完全支持继承.重载.多重继 ...

  2. C# 有哪些集合

    队列[Queue] //队列:先进先出 /* *增加元素到队列结尾处 *移除队列开始处 */ Queue queue=new Queue(); queue.Enqueue(Object); queue ...

  3. 『计算机视觉』Mask-RCNN_推断网络其四:FPN和ROIAlign的耦合

    一.模块概述 上节的最后,我们进行了如下操作获取了有限的proposal, # [IMAGES_PER_GPU, num_rois, (y1, x1, y2, x2)] # IMAGES_PER_GP ...

  4. MVC实战之排球计分(一)—— 需求分析与数据库设计

    此系列博客目的是制作一款排球计分程序.这系列博客讲讲述此软件的 各个功能的设计与实现. 一.需求分析: 这个程序是排球计分程序,其业务非常简单,具体如下: 1.本程序可以选择用户身份,通过不同角度记录 ...

  5. 函数使用十:COMMIT

    1)DB_COMMIT    :                    DB层的COMMIT,很少用到,大S之前说过,忘了 2)BAPI_TRANSACTION_COMMIT:COMMIT WORK/ ...

  6. Chargen UDP服务远程拒绝服务攻击漏洞修复教程

    一.前置说明 chargen服务最初设计用于测试网络状态,监听19端口(包括TCP和UDP),其中UDP协议存在“Chargen UDP服务远程拒绝服务攻击漏洞”. chargen一般不会使用,所以直 ...

  7. Java 8 默认方法(Default Methods)

    Java 8 默认方法(Default Methods) Posted by Ebn Zhang on December 20, 2015 Java 8 引入了新的语言特性——默认方法(Default ...

  8. C#调用接口返回json数据中含有双引号 或其他非法字符的解决办法

    这几天,调用别人接口返回json数据含有特殊符号(双引号),当转换成json对象总是报错, json字符格式如下 { "BOXINFO":[ { ", "ITE ...

  9. Java集合list,map,set区别及遍历

    1.1 List.Set.Map基本区别 1.List,Set都是继承Collection接口,Map不是. 2.List:LinkedList.ArrayList.Vector Set :HashS ...

  10. sql根据年月日查询注册数或者和值

    //公司需要我做一个根据每天用户注册数量生成一个折现图,sql如下,//亲测好用,只是如果某一天没有注册的话,就不会显示日期 SELECT DATE_FORMAT(f.registDate, '%Y- ...