最近做项目,发现了一个报错  Only variables can be passed by reference,  意思是“只有变量能通过‘引用’”

就是在代码中 使用了一个方法,这个方法的参数值传址引用的例如php的 end方法

php官网的说法

(PHP 4, PHP 5)

end — 将数组的内部指针指向最后一个单元

说明

mixed end ( array &$array )

end() 将 array 的内部指针移动到最后一个单元并返回其值。

参数

array

这个数组。 该数组是通过引用传递的,因为它会被这个函数修改。 这意味着你必须传入一个真正的变量,而不是函数返回的数组,因为只有真正的变量才能以引用传递。

返回值

返回最后一个元素的值,或者如果是空数组则返回 FALSE

错误的使用:

end( explode(".", $file_name) )

正确的使用

$file_extend = explode(".", $file_name);

end($file_extend);

原文地址:php Only variables can be passed by reference
标签:php   reference   variables   end

智能推荐

php Only variables can 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. [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_ ...

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

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

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

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

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

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

  9. Only variables should be passed by reference

    报错位置代码: $status->type = array_pop(explode('\\',$status->type))   (此处$status->type值原本是  APP\ ...

随机推荐

  1. PHP代码审计笔记--命令执行漏洞

    命令执行漏洞,用户通过浏览器在远程服务器上执行任意系统命令,严格意义上,与代码执行漏洞还是有一定的区别. 0x01漏洞实例 例1: <?php $target=$_REQUEST['ip']; ...

  2. 重命名和重定向RF执行生成的output文件

    命令: pybot -d output文件保存路径 -o output文件重命名 -d --outputdir dir Where to create output files. The defaul ...

  3. Linux eject 命令

    eject命令允许在软件控制下弹出可移动媒体(通常是CD-ROM .软盘 .USB等) [root@localhost ~]# eject cdrom //弹出名字为cdrom的设备或者挂载点 [ro ...

  4. It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing ___Error Installing APK

    一 : 根据以下路径,找到Instant Run中的选项         File —— Settings——Build,Execution,Deployment——Instant Run       ...

  5. code_blocks 使用操作手册

                                                                              38 39 编译以上程序,产生如下提示信息. 如此简 ...

  6. button按钮不能点击鼠标形状css 代码,禁用button按钮时鼠标形状

    cursor:not-allowed;

  7. .net 将DLL程序集生成到指定目录中

    .在程序集右键属性 .在程序集属性界面中找到生成事件 在预先生成事件命令行添加: IF NOT EXIST "$(ProjectDir)..\Bin" MD "$(Pro ...

  8. linux计划任务之crontab

    语法:        crontab [ -u user ] file        crontab [ -u user ] [ -i ] { -e | -l | -r } 说明: crontab命令 ...

  9. 修改计算机名或IP后Oracle10g无法启动服务的解决办法

    修改计算机名或IP后Oracle10g无法启动服务的解决办法 遇到的问题,问题产生原因不详.症状为,windows服务中有一项oracle服务启动不了,报出如下错误. Windows 不能在 本地计算 ...

  10. Delphi应用程序的调试(五)其他调试工具

    Delphi应用程序的调试(五)其他调试工具 Delphi7中提供了一些附加调试工具来帮助用户检查程序错误.从性能上讲,其中一些工具属于高级调试工具.尽管高级调试工具不像其他工具那样常用,但对于经验丰 ...