使用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. 微信小程序发起微信支付

    点击链接查看详情:(支付中配置参数需要从后台得到->签名需要从微信申请才可以得到) https://mp.weixin.qq.com/debug/wxadoc/dev/api/api-pay.h ...

  2. PHP中工厂模式与策略模式区别

    策略模式需要自己动手去做,工厂模式是都准备好了你需要选择 工厂模式:有一天你决定去吃披萨,一看菜单,哦,种类很多呀,你就点了个培根披萨,过了二十分钟,你的披萨就来了就可以吃到了.但这个披萨是怎么做的, ...

  3. PHP工厂模式的使用场景,使用方法

    所谓工厂模式和生产有关.生产什么呢?生产出来的是一个实例对象.通过什么设备生产?通过一个工厂类生产simpleFactoty.怎么生产呢?工厂类调用自身静态方法来生产对象实例static functi ...

  4. php字段转义

    addslashes() 函数返回在预定义的字符前添加反斜杠的字符串. 预定义字符是:在以下符号前加/ 单引号(') 双引号(") 反斜杠(\) NULL parse_str($str,$a ...

  5. CF1117E Decypher the String

    如果我们能询问一个排列的话,我们就可以得到这个置换,然后反向求解. 但现在字符集只有26. 考虑26^3>1e5. 用一个三维坐标去映射到一个一维整数,然后就可以构造排列了. #include& ...

  6. 为什么一刷新页面session没了

    最常见的的原因: session_start(); 没有放在文件最上面……

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

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

  8. PAT 1009 Product of Polynomials

    1009 Product of Polynomials (25 分)   This time, you are supposed to find A×B where A and B are two p ...

  9. virtualbox 中centOS在不能ssh

    这个重要跟虚拟机的网络设置有关系.废话不多说. 针对一个网卡的形式.可以如下进行配置 1.网络-- 连接方式还选择“网络地址转换(NAT)” 其他不变,展开高级,设置端口转发  主机IP设为本机IP, ...

  10. vul/0day/shellcode/payload/poc/exp

    vul--泛指漏洞 0day--未公开或虽已公开但还没有修复方法的漏洞 shellcode--远程溢出后执行的那段代码 payload--攻击载荷,送到远端机器执行的整段代码 poc--Proof o ...