php Only variables can be passed by reference
最近做项目,发现了一个报错 Only variables can be passed by reference, 意思是“只有变量能通过‘引用’”
就是在代码中 使用了一个方法,这个方法的参数值传址引用的例如php的 end方法
php官网的说法
(PHP 4, PHP 5)
end — 将数组的内部指针指向最后一个单元
参数¶
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
智能推荐
- 【实战】Docker 入门实战一:安装Dockeer
- Nginx return 关键字配置小技巧
- php 请求参数限制
- 【No.5 Ionic】修改 应用名,icon,启动界面
- 完美解决failed to open stream: HTTP request failed!(file_get_contents引起的)
php Only variables can 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解决办法,希望此教程 对各位同 ...
- [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_ ...
- Ecshop提示Only variables should be passed by reference in错误
Ecshop是个坑爹货,为什么tiandi会说它是个坑爹货呢,请看一下下面的官方的运行环境推荐: 服务器端运行环境推荐·php版本5.0以上5.3以下的版本(推荐使用5.2系列版本)·Mysql版本5 ...
- 出现Strict Standards: Only variables should be passed by reference in的解决方法
出现Strict Standards: Only variables should be passed by reference in的解决方法 代码报错: <br /><b> ...
- php报警:Strict Standards: Only variables should be passed by reference in
错误原因 因为end函数的原因. end函数: mixed end ( array &$array ) 你可以看到end的参数是一个引用(reference),而你只能把一个变量的引 ...
- Only variables should be passed by reference
报错位置代码: $status->type = array_pop(explode('\\',$status->type)) (此处$status->type值原本是 APP\ ...
随机推荐
- {"errorCode":50} 的解决办法
# 无反爬 import urllib.parse import urllib.request import json content = input('请输入需要翻译的词语:') # url = ' ...
- windows应急响应入侵排查思路
0x00 前言 当企业发生黑客入侵.系统崩溃或其它影响业务正常运行的安全事件时,急需第一时间进行处理,使企业的网络信息系统在最短时间内恢复正常工作,进一步查找入侵来源,还原入侵事故过程,同时给出解 ...
- iOS开发--改变tableHeaderView的高度
1.先获取tableHeaderView 2.设置它的frame 3.将该view设置回tableview UIView *view=tableView. tableHeaderView; view. ...
- Unity3d OnApplicationPause与OnApplicationFocus
在手机游戏当中,会碰到“强制暂停”,如:锁屏.接电话或短信之类的.如果“强制暂停”时间过长,网络游戏有时得重新登录等事件. 而Unity3d,Android Plugins中的UnityPlayer. ...
- Java调用MQ队列
IBM MQ 6.0中设置两个队列,(远程队列.通道之类都不设置). 队列管理器是XIR_QM_1502 队列名称是ESBREQ IP地址是10.23.117.134(远程的一台电脑,跟我的电脑不在一 ...
- Spring Web 应用的最大败笔
开发人员在使用Spring应用是非常擅长谈论依赖注入的好处.不幸的是,他们不是那么真的利用它的好处,如单一职责原则,分离关注原则.如果我们一起来看看大部分Spring的Web应用程序,常见的错误的设计 ...
- Kafka版本升级 ( 0.10.0 -> 0.10.2 )
升级Kafka集群的版本其实很简单,核心步骤只需要4步,但是我们需要在升级的过程中确保每一步操作都不会“打扰”到producer和consumer的正常运转.为此,笔者在本机搭了一个测试环境进行实际的 ...
- Struts2(三)配置详解
一.概述 Struts2提供了多种可选的配置文件形式. 其中,struts-default.xml和default.properties是框架级别的配置文件,这两个文件在Struts的核心JAR包中, ...
- 安装ahci驱动后出现A disk read error occurred如何解决
注意:因为一般的ghost系统盘都没有ahci驱动,所以,如果用到固态硬盘且想更好的发挥固态硬盘的性能,需要安装ahci驱动,且在bios 中把硬盘模式设置成ahci(否则电脑会蓝屏或进不去系统) 步 ...
- liunx trac 邮件提示功能
http://trac.edgewall.org/wiki/TracNotification官网上提供的方法.个人觉得不是清楚,不过还是有参考价值的.以下写下自己的添加过程,以作记录. 1.the [ ...