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

来自:吾爱编程
时间:2022-04-08
阅读:

在网上找了一个方法执行的时候提示Strict Standards: Only variables should be passed by reference in,接下来吾爱变成为大家介绍一下解决方法,有需要的小伙伴可以参考一下

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

1、错误提示:

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

2、错误原因:

PHP5.3以及PHP5.3以上默认只能传递具体的变量,而不能通过函数返回值传递,当然也不是所有的PHP函数都不支持这种写法

3、解决方法:

    (1)、更改PHP版本到5.3以下

    (2)、更改写法,以下是我测试的实例代码

$dstimage = "itbiancheng.jpg";
$suffix = strtolower(array_pop(explode('.', $dstimage ) ) );
//改成以下代码
$arr = explode('.', $dstimage );
$suffix = strtolower(array_pop($arr));
var_dump($suffix);

4、运行截图如下:

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

返回顶部
顶部