0

I get an error on some pages of my website:

Strict Standards: Only variables should be passed by reference in /home/... on line 777

here is this line:

$arg_list = $this->_compile_arg_list('function', $tag_command, $attrs, $_cache_attrs='');

What should I change? Any help is appreciated.

The problem solved, thanks.

3 Answers3

1
<?php

function foo(&$a){
}

$a = 33;
foo($a); // OK

foo(33); // Fatal error: Only variables can be passed by reference

So fix your code accordingly.

Álvaro González
  • 142,137
  • 41
  • 261
  • 360
0

You cannot assign a value in a function call that expects a variable by reference, if you need a default behavior you can set that up in the function itself or before calling it.

$_cache_attrs = '';
$arg_list = $this->_compile_arg_list('function', $tag_command, $attrs, $_cache_attrs);
php_nub_qq
  • 15,199
  • 21
  • 74
  • 144
0

maybe 'function' should be callable..

$function = function() { };
$arg_list = $this->_compile_arg_list(
    $function,
    $tag_command,
    $attrs,
    $_cache_attrs=''
);
Daniel W.
  • 31,164
  • 13
  • 93
  • 151