// 报错代码: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的更多相关文章

  1. 已解决:Strict Standards: Only variables should be passed by reference in

    今天安装ecshop的时候最上面出现了一个错误提示:Strict Standards: Only variables should be passed by reference in F:\www.x ...

  2. 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 ...

  3. 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 ...

  4. ECshop Strict Standards: Only variables should be passed by reference in解决办法

    本文章来给各位同学介绍关于ECshop Strict Standards: Only variables should be passed by reference in解决办法,希望此教程 对各位同 ...

  5. 出现Strict Standards: Only variables should be passed by reference in的解决方法

    出现Strict Standards: Only variables should be passed by reference in的解决方法 代码报错: <br /><b> ...

  6. 解决Strict Standards: Only variables should be passed by reference

    这个错误发生在大家php调试程序用到一段代码里,那就是格式化显示出变量的函数functionrdump($arr)的第5行, 这段代码出自ecmall团队之手,但是ecmall已经很古董了,在php5 ...

  7. php报警:Strict Standards: Only variables should be passed by reference in

    错误原因 因为end函数的原因. end函数: mixed end    ( array &$array   ) 你可以看到end的参数是一个引用(reference),而你只能把一个变量的引 ...

  8. Ecshop提示Only variables should be passed by reference in错误

    Ecshop是个坑爹货,为什么tiandi会说它是个坑爹货呢,请看一下下面的官方的运行环境推荐: 服务器端运行环境推荐·php版本5.0以上5.3以下的版本(推荐使用5.2系列版本)·Mysql版本5 ...

  9. 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 ...

随机推荐

  1. CF402D Upgrading Array

    原题链接 先用素数筛筛下素数,然后考虑贪心去操作. 先求前缀\(GCD\)(求到\(GCD\)为\(1\)就不用再往下求了),得到数组\(G[i]\),然后从后往前扫,如果\(f(G[i]) < ...

  2. CODE[VS]2494 Vani和Cl2捉迷藏

    原题链接 这里有一个结论:最多能选取的藏身点个数等于最小路径可重复点覆盖的路径总数. 所以我们可以先传递闭包,然后求最小路径点覆盖即可. #include<cstdio> #include ...

  3. tableView上出现空白的解决办法

    创建tableView后,出现如下效果       解决办法: self.automaticallyAdjustsScrollViewInsets = NO; 个人认为,应该是取消系统默认行为,保证界 ...

  4. python-bs4的使用

    BeautifulSoup4 官方文档 是一个Python库,用于从HTML和XML文件中提取数据.它与您最喜欢的解析器一起使用,提供导航,搜索和修改解析树的惯用方法.它通常可以节省程序员数小时或数天 ...

  5. 论坛:设计实体-->分析功能-->实现功能 之 《分析功能》

    其中 管理文章 的功能没有做,以下做的设计 浏览与参与 功能的步骤 分析功能   5个功能.   7个请求. 实现功能   Action, 7个方法   Service   Dao   Jsp For ...

  6. 状态机学习(三)解析JSON1

    来自 从零开始的 JSON 库教程 从零开始教授如何写一个符合标准的 C 语言 JSON 库 作者 Milo Yip https://zhuanlan.zhihu.com/json-tutorial ...

  7. mybatis @SelectKey加于不加的区别

    正常情况下,我们设置表的主键自增,然后: @Insert("insert into miaosha_order (user_id, goods_id, order_id)values(#{u ...

  8. ueditor 功能定制

    方法一:用js传参 var editor = new UE.ui.Editor({initialFrameHeight:200,initialFrameWidth:640,toolbars:[[&qu ...

  9. Gym - 100735E Restore

    E - Restore 题意:输入一个n,输入一个对角线空缺(为0)的n*n的矩阵,要求每一行每一列和对角线的和相同,输出完整的矩阵. 解法:设每一行的和都是sum,用一个h[]数组存每一行的和.则可 ...

  10. Linux运维之shell脚本

    一.bash漏洞 1)bash漏洞 bash漏洞是控制Linux计算机命令提示符的软件中存在的漏洞. bash是一个为GNU计划编写的Unix shell.它的名字是一系列缩写:Bourne-Agai ...