There are two ways to pass information to a function in PHP:
Functions define how they want to receive their arguments. If they expect to receive it as a reference, that means that the changes the function makes to the variable will have an effect in the scope where the function was called.
If you provide a value where the function is expecting a reference, the function won't properly do what you expect.
For instance, array_splice
expects its first argument to be a reference, so that you can get the modifications made to the array. But imagine if you did this:
array_splice(array('foo', 'bar'), 1);
You've passed in a value, not a reference. The code that called your function can't get the modified array, because array_splice
doesn't return it. The correct way is like this:
$array = array('foo', 'bar');
array_splice($array, 1);
echo count($array); // echoes 1
This is because array_splice
takes a reference, and so modifies a variable.
In your case, you're doing this:
JBPlug_do_callback('jb_init', $A=false);
Presumably, JBPlug_do_callback
is expecting a reference as its second argument. You are providing a value (=
returns a value). It may make no difference to what the function does, but technically it's a breach of PHP's rules. (That's why it's a "strict standards" error: it may well not have a bad effect, but it's technically invalid.)
You can solve this, again, simply by providing what PHP wants: a variable:
$A = false;
JBPlug_do_callback('jb_init', $A);