Strict Standards: Declaration of UserModel::toJSON() should be compatible with that of BaseModel::toJSON()
使用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()的更多相关文章
- php 错误 Strict Standards: PHP Strict Standards: Declaration of .... should be compatible with that of 解决办法
错误原因:这是由于 php 5.3版本后.要求继承类必须在父类之后定义.否则就会出现Strict Standards: PHP Strict Standards: Declaration of ... ...
- PHP Strict standards:Declaration of … should be compatible with that of…(转)
今天把原来一份很老的PHP代码导入到了PaaS上,出现了许多Strict standards:Declaration of … should be compatible with that of…这样 ...
- PHP中Strict Standards错误解决方法二
在PHP5.3.3 中安装wordpress 3.0.1 ,在安装时出现错误:Strict Standards: PHP Strict Standards: Declaration of Walker ...
- PHP Strict Standards:问题解决
异常信息: ( ! ) Strict standards: Declaration of SugarEmailAddress::save() should be compatible with tha ...
- 安装ECMall后报PHP Strict Standards错误,请问如何解决
Strict Standards: Non-static method ECMall::startup() should not be called statically in /htdocs/ecm ...
- 已解决:Strict Standards: Only variables should be passed by reference in
今天安装ecshop的时候最上面出现了一个错误提示:Strict Standards: Only variables should be passed by reference in F:\www.x ...
- 已解决: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 ...
- 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 ...
- 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 ...
随机推荐
- stark组件base.html
stark 组件基础页面base.html 文件 base.html 1. base.html 页面是 : stark组件增,删,改,查页面的公共部分,如头部导航栏,左侧的用户权限列表栏等. 2. b ...
- Vue音乐项目笔记(四)(搜索页面提取重写)
1.如何通过betterScroll组件实现上拉刷新 https://blog.csdn.net/weixin_40814356/article/details/80478440 2.搜索页面跳转单曲 ...
- Python Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat)
在windows 平台下,当python使用以下方式安装时,可能出现以下错误: > python setup.py install error: Microsoft Visual C++ 10. ...
- linux平台的oracle11201借用expdp定时备份数据库
备份脚本如下: #!/bin/bashexport ORACLE_BASE=/data/oracle export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db ...
- myeclipse debug模式 报错source not found
myeclipse debug模式下,启动报错 source not found:SignatureParser.current() line: 解决方法:将debug视图下的右上方的jar有断点的地 ...
- Python条件判断和循环,range()函数
条件判断经常使用if语句进行判断,表达方式为:if 条件语句: :elif:else if...用于执行第一条不满足if的判断,继续执行其它的判断.比如一个简单的if判断 Python3取消 ...
- 十三、MVC的WEB框架(Structs2)
一.Structs2的应用 Structs2是基于MVC的WEB框架.一般基于框架的程序要运行成功,对于JAR包的版本,配置文件的正确性有着苛刻的要求,一个地方错了,都会导致框架程序运行出错. 1.首 ...
- 数组Array.sort()排序的方法
数组sort排序 sort比较次数,sort用法,sort常用 描述 方法sort()将在原数组上对数组元素进行排序,即排序时不创建新的数组副本.如果调用方法sort()时没有使用参数,将按字母顺序( ...
- Linux安装配置NFS教程(CentOS 6.5)
一.服务端安装nfs 1.1安装 yum install -y rpcbind yum install -y nfs-utils 1.2配置nfs共享目录 这里以/nfs目录为例 mkdir /nfs ...
- FileZilla Server隐藏版本号教程
1.查看当前是否泄漏版本号 telnet FileZilla监听端口查看返回信息:telnet 192.168.220.130 21 2.自定义欢迎信息 登录FileZilla--点击“Edit”-- ...