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 ...
随机推荐
- 【洛谷p1601】A+B Problem(高精)
高精度加法的思路还是很简单容易理解的 A+B Problem(高精)[传送门] 洛谷算法标签: 附上代码(最近懒得一批) #include<iostream> #include<cs ...
- selenum threding多线程运行 实例
1.配置相关驱动 chrome驱动 下载驱动,配置到环境变量中 如 xxxxchrome.jar 将其新建目录c:/driver---将目录 配置到环境变量 firefox驱动 下载驱动,将gecko ...
- Android BottomNavigationBar底部导航控制器的使用(包含默认postion的设置)
转载请标明出处:http://blog.csdn.net/u010046908/article/details/50962081本文出自:[李东的博客] 最近Google在自己推出的Material ...
- php 出现Warning: A non-numeric value encountered问题的原因及解决方法
在使用(+ - * / ** % << >> | & ^) 运算时,例如a+b,如果a是开始一个数字值,但包含非数字字符(123a),b不是数字值开始时(b456),就 ...
- hbase的api操作
创建maven工程,修改jdk pom文件里添加需要的jar包 dependencies> <dependency> <groupId>jdk.tools</gro ...
- 小程序setData修改数组某一项的值
官方文档是这样的: changeItemInArray: function() { // you can use this way to modify a danamic data path this ...
- 利用tablespace特性将数据库移动到新磁盘
目前开发一台EC2的PostgreSQL服务器的磁盘空间已经严重不足,该磁盘非LVM,所以不考虑磁盘扩容方法,研发希望可以分区/data/02对应的/dev/xvdl1磁盘分担部分数据库的数据,这样也 ...
- telnet限制用户连接数(CentOS)
一.配置方法 编缉/etc/xinetd.d/telnet在大括号内追加: cps = instances = per_source = 保存然后使用service xinetd restart重启x ...
- Windows服务手动关闭教程
Windows上关闭软件自启动,经常使用360等软件的开机加速功能去优化. 但有时候有些服务开机是启动的但在360中并没有找到那如何手动关闭这些服务的自启动呢? 下边以Autodesk Applica ...
- Ubuntu Windows双系统重装windows后看不到ubuntu启动引导
1.下载并安装Easy BCD 2.点击编辑引导菜单,看到只有windows一项 3.点击“添加新条目”,添加引导菜单,选择linux/bsd ,类型选择GRUB 2,然后输入名称,选择Ubuntu所 ...