[php-error-report]PHP Strict Standards: Only variables should be passed by reference
// 报错代码:PHP Strict Standards: Only variables should be passed by reference $arr_userInfo['im_nation_cn'] = array_shift(preg_split('/,/' , $arr_userInfo['im_nation_cn']); // 修改后,不再报错的代码,原因是 PHP 自带的函数 array_shift()是以引用的方式来传参,而引用传参,只能是一个变量
$arr_im_nation_cn = preg_split('/,/' , $arr_userInfo['im_nation_cn']);
$arr_userInfo['im_nation_cn'] = array_shift($arr_im_nation_cn) ; // Google 出来的原解答 , 原文链接:http://stackoverflow.com/questions/2354609/strict-standards-only-variables-should-be-passed-by-reference
/*
Consider the following code: error_reporting(E_STRICT);
class test {
function test_arr(&$a) {
var_dump($a);
}
function get_arr() {
return array(1,2);
}
} $t= new test;
$t->test_arr($t->get_arr());
This will generate the following output: Strict Standards: Only variables should be passed by reference in test.php on line 14
array(2) {
[0]=>
int(1)
[1]=>
int(2)
}
The reason? The test::get_arr() method is not a variable and under strict mode this will generate a warning. This behavior is extremely non-intuitive as the get_arr() method returns an array value. To get around this error in strict mode either change the signature of the method so it doesn't use a reference: function test_arr($a) {
var_dump($a);
}
Since you can't change the signature of array_shift you can also use an intermediate variable: $inter= get_arr();
$el= array_shift($inter);
*/
[php-error-report]PHP Strict Standards: Only variables should be passed by reference的更多相关文章
- 已解决: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: 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 ...
- ECshop Strict Standards: Only variables should be passed by reference in解决办法
本文章来给各位同学介绍关于ECshop Strict Standards: Only variables should be passed by reference in解决办法,希望此教程 对各位同 ...
- 出现Strict Standards: Only variables should be passed by reference in的解决方法
出现Strict Standards: Only variables should be passed by reference in的解决方法 代码报错: <br /><b> ...
- 解决Strict Standards: Only variables should be passed by reference
这个错误发生在大家php调试程序用到一段代码里,那就是格式化显示出变量的函数functionrdump($arr)的第5行, 这段代码出自ecmall团队之手,但是ecmall已经很古董了,在php5 ...
- php报警:Strict Standards: Only variables should be passed by reference in
错误原因 因为end函数的原因. end函数: mixed end ( array &$array ) 你可以看到end的参数是一个引用(reference),而你只能把一个变量的引 ...
- Ecshop提示Only variables should be passed by reference in错误
Ecshop是个坑爹货,为什么tiandi会说它是个坑爹货呢,请看一下下面的官方的运行环境推荐: 服务器端运行环境推荐·php版本5.0以上5.3以下的版本(推荐使用5.2系列版本)·Mysql版本5 ...
- MagicZoom bug-Strict Standards: Only variables should be assigned by reference Error
问题:zencart Strict standards: Only variables should be assigned by reference in jscript_zen_magiczoo ...
随机推荐
- 最详细的Axure动态面板使用教程
1.打开[Axure]软件,在index文件上新建一个375*667大小的背景矩形并绘制页面. 具体如图所示. 2.在banner的位置上新建一个[动态面板],双击动态面板在其中新建state1.st ...
- 论坛:Error:No result defined for action cn.itcast.oa.view.action.TopicAction and result
使用了<s:hidden name="forumId" value="#forum.id"/> 可以改为: <s:hidden name=&q ...
- mybatis学习 十二 多表查询
Mybatis 实现多表查询方式: (1)业务装配.对两个表编写单表查询语句,在业务(Service)把查询的两个结果进行关联. (2)使用Auto Mapping特性,在实现两表联合查询时通过别名完 ...
- java ajax请求后台并获取到返回值
js: $.ajax({ url : '../Islogin.do', type : 'get', cache : false, dataType : 'json', success : functi ...
- 2019.02.09 bzoj4455: [Zjoi2016]小星星(容斥原理+dp)
传送门 题意简述:给一张图和一棵树(点数都为n≤17n \le17n≤17),问有多少种给树的标号方法方法使得图中去掉多余的边之后和树一模一样. 思路: 容斥好题啊. 考虑fi,jf_{i,j}fi, ...
- 2018.11.07 bzoj2751: [HAOI2012]容易题(easy)(组合数学)
传送门 组合数学一眼题. 感觉一直做这种题智商会降低. 利用组合数学的分步计数原理. 只用关心每个数不被限制的取值的总和然后乘起来就可以了. 对于大部分数都不会被限制,总和都是n(n+1)2\frac ...
- 2018.10.26 洛谷P4551 最长异或路径(01trie)
传送门 直接把每个点到根节点的异或距离插入01trie. 然后枚举每个点在01trie上匹配来更新答案就行了. 代码: #include<iostream> #include<cst ...
- poj-2406(字符串hash)
题目链接:传送门 思路:字符串hash,终止条件竟然判断错了,真是太大意了. #include<iostream> #include<cstdio> #include<c ...
- 【MVC】bootstrap-paginator 分页
[MVC]bootstrap-paginator 分页http://www.cnblogs.com/stoneniqiu/p/4000041.htmlhttp://www.cnblogs.com/Le ...
- 普通用户修改.bash_profile 权限问题
例如oracle用户想要修改它下面的.bash_profile文件: 在命令行运行: [root@localhost ~]# ls -lh /home/oracle/.bash_profile