这个错误发生在大家php调试程序用到一段代码里,那就是格式化显示出变量的函数functionrdump($arr)的第5行, 这段代码出自ecmall团队之手,但是ecmall已经很古董了,在php5.3以上版本会出这个问题,应该也和php的配置有关,只要把这一句拆成两 句就没有问题了。因为array_walk的参数是引用传递的,5.3以上默认只能传递具体的变量,而不能通过函数返回值。当然你也可以修改 php.ini 里的 error_reporting = E_ALL | E_STRICT,但这终究不符合规范。

有问题的代码:

<?php
function rdump($arr)
{
echo '<pre>';
array_walk(func_get_args(), create_function('&$item, $key', 'print_r($item);'));
echo '</pre>';
exit();
} $arr = array(1, 2, 3);
rdump($arr);

推荐修改为:

<?php
function rdump($arr)
{
echo '<pre>';
$array = func_get_args();
array_walk($array, create_function('&$item, $key', 'print_r($item);'));
echo '</pre>';
exit();
} $arr = array(1, 2, 3);
rdump($arr);

最终可以完美不报错:

解决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. 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 ...

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

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

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

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

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

  6. [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_ ...

  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. 关于Linux的10个核心面试问题与答案

    转载:http://www.linuxeden.com/html/news/20140222/148676.html 又到了以轻松的心情来读些严肃内容的时刻了,哈!这是另一篇关于面试问题的文章,我们将 ...

  2. Eclipse配置C/C++开发环境

    开发环境:Eclipse3.2.CDT3.1.MinGW5.1 1.Eclipse及CDT的安装到Eclipse的官方网站http://www.eclipse.org上下载Eclipse.安装CDT. ...

  3. Last non-zero Digit in N!

    Problem Description The expression N!, read as "N factorial," denotes the product of the f ...

  4. 1045 | error connecting to master 'slave_user@192.168.0.75:3306' - retry-time: 6

    mysql 主从复制问题整理   问题:      1045 | error connecting to master 'slave_user@192.168.0.75:3306' - retry-t ...

  5. LeetCode 3

    Longest Substring Without Repeating Characters Given a string, find the length of the longest substr ...

  6. GDB调试器简介

     Linux系统中包含了GNU 调试程序gdb,它是一个用来调试C和 C++ 程序的调试器.可以使程序开发者在程序运行时观察程序的内部结构和内存的使用情况. GDB提供了一下一些功能: (1)监视程序 ...

  7. Android混淆打包配置总结

    Android打包失败出现Proguard returned with error code 1. See console的错误 这个问题是由于代码混淆引起的,找不到引用包. 只需在你的proguar ...

  8. IIS 发布网站到外网

    前段时间做了一个项目在局域网中测试后要发布到外网上,一时间不知怎么搞,以为直接在IIS中修改发布时的IP就可以了,但是不可行,经过摸索终于成功发布到外网,下面是具体步骤. 前期准备:公网IP,掩码,网 ...

  9. Sqlite官方下载对应版本注意细节

    官网下载地址: http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki 下载注意事项: 1.对应.net平台 2.对 ...

  10. HDOJ2000ASCII码排序

    ASCII码排序 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Su ...