// 报错代码: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. ZBlog你选择PHP还是ASP?

    最近趁着空闲玩了一下zblog,对于很多第一次接触zblog的博主大多都会问zblog是PHP好还是ASP好?我们应该如何选择?其实,对于这个问题我也不是很懂,我个人比较倾向于PHP.今天我就整理一下 ...

  2. ATM作业

    关于ATM作业,最近做了很久,才明白,其实看了很久的作业视频讲解,到不如将作业的整个下载下来进行运行,去了解程序本身的结构和运行方式.首先说需求,就感觉是各种懵逼,这才学了函数,和模块之间的简单调用就 ...

  3. day2-pycharm创建项目,driver下载和浏览器设置

    对于ie需要设置,才能使用ie做测试 火狐的使用不能超过43版本,ie11现在有多次弹出alert无法识别其内容的问题 https://github.com/SeleniumHQ/selenium/w ...

  4. 深入研究 UCenter API For .NET

    康盛旗下产品的搭建 来自http://www.dozer.cc/2011/02/ucenter-api-in-depth-4th/ 1.UCenter 这个当然是最基本的东西,安装起来也很简单,官方就 ...

  5. 【51NOD】1006 最长公共子序列Lcs(动态规划)

    给出两个字符串A B,求A与B的最长公共子序列(子序列不要求是连续的). 比如两个串为:   abcicba abdkscab   ab是两个串的子序列,abc也是,abca也是,其中abca是这两个 ...

  6. C#中隐式运行CMD命令行窗口的方法

    using System; using System.Diagnostics; namespace Business { /// <summary> /// Command 的摘要说明. ...

  7. boost--asio

    1.asio综述 asio的核心类是io_service,它相当于前摄器模式的Proactor角色,在异步模式下发起的I/O操作,需要定义一个用于回调的完成处理函数,当I/O完成时io_service ...

  8. Vue.js 教程

    http://www.runoob.com/vue2/vue-routing.html

  9. s4-2 ALOHA 协议

    多路访问协议  随机访问协议(Random Access) 特点:站点争用信道,可能出现站点之间的冲突 典型的随机访问协议 • ALOHA协议 • CSMA协议 • CSMA/CD协议(以太网采 ...

  10. s4-介质访问控制子层-1 MAC子层

    数据链路层被分成了两个子层:MAC和LLC MAC子层要解决什么问题? 介质访问控制(Madia Access Control) 数据通信方式 单播(unicast):One - to - One ...