使用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. CF1107E Vasya and Binary String

    比赛的时候又被垃圾题艹翻了啊. 这个题显然是区间dp 考虑怎么转移. 类似消除方块和ZYB玩字符串那样的一个DP. 可以从左到右依次考虑消除. dp[l][r][k][flag]表示区间l,r左边粘着 ...

  2. Digital Deletions HDU - 1404

    Digital deletions is a two-player game. The rule of the game is as following. Begin by writing down ...

  3. 最长回文字串——manacher算法

    时间复杂度:O(n) 参考:https://segmentfault.com/a/1190000003914228 1.问题定义 最长回文子串问题:给定一个字符串,求它的最长回文子串长度. 如果一个字 ...

  4. 日期在Linux与Windows下的区别

    最近遇到了这个问题,就是相同的代码在Windows与Linux下的日期转换不一致. 原因:时区问题,主要是操作系统与JVM中的时区不同导致的 在网上查了很多处理的方法:最后总结出一条简单粗暴的方法:原 ...

  5. Python PIL模块笔记

    利用python pil 实现给图片上添加文字 图片中添加文字#-*- coding: utf-8 -*- from PIL import Image,ImageDraw,ImageFont ttfo ...

  6. 谈一谈HashMap类2

    1.由一个小案例引出本博文的讨论 public class Demo1 { public static void main(String[] args) throws Exception { Stud ...

  7. React文档(四)渲染元素

    元素是React应用的最小单位. 一个React元素描述了你在屏幕上所看到的东西: const element = <h1>Hello, world</h1>; 和浏览器页面中 ...

  8. CRM 价格批导2<上一个太多冗余>

    INCLUDE:LCRM_MKTPL_COND_IFF39 *--------------------------------------------------------------------- ...

  9. PyCharm调试运行Scrapy教程

    一.使用scrapy创建一个项目 这里使用scrapy官方第一个示例 scrapy startproject tutorial 使用PyCharm打开项目,在tutorial/tutorial/spi ...

  10. weblogic补丁安装失败(Patch B25A is mutually exclusive and cannot coexist with patch(es): UIAL)

    由于曝出漏洞(CVE-2017-3248)需要将weblogic补丁更新至B25A,但是出现报错.如下: Conflict(s) detected - resolve conflict conditi ...