Strict Standards: Only Variables Should Be Assigned by Reference PHP 5.4

Strict Standards: Only variables should be assigned by reference PHP 5.4

You should remove the & (ampersand) symbol, so that line 4 will look like this:

$conn = ADONewConnection($config['db_type']);

This is because ADONewConnection already returns an object by reference. As per documentation, assigning the result of a reference to object by reference results in an E_DEPRECATED message as of PHP 5.3.0

PHP Strict Standards: Only variables should be passed by reference in

The problem is this part of your code:

<?php
smarty_block_m3_validate_box($this->_tag_stack[count($this->_tag_stack)-1][1], $this->_block_content, $this, $_block_repeat=false);

You created smarty_block_m3_validate_box with:

<?php
function smarty_block_m3_validate_box($params, $content, &$smarty, &$repeat)

(Parameter 3 and 4 are passed by reference)

Now you're trying to pass $_block_repeat=false as the third parameter, which will work, but throws an E_STRICT error (like you get). The solution would be to assign $_block_repeat with the value you want and pass it to the function:

<?php
$_block_repeat = false;
smarty_block_m3_validate_box($this->_tag_stack[count($this->_tag_stack)-1][1], $this->_block_content, $this, $_block_repeat);

end(explode) Strict Standards: Only variables should be passed by reference in

Why not use pathinfo (PHP >= 4.0.3), i.e.:

$ext = pathinfo($_FILES["rfile"]["name"])['extension'];

Live PHP demo

http://ideone.com/eMpbnL

PHP Strict Standards: Only variables should be passed by reference in .lib

This error happens because some functions not only return values but also (try to) change passed parameters (these params need to be passed by reference, because otherwise their value would be copied and there would be no effect outside function scope).

For example reset() returns first element, but also changes internal array pointer (current elemtent). If you pass an array not assigned to any variable (direct result of the function call) the pointer cannot be set, because this array in outer scope doesn't longer exist. To fix line 309 you need to split command into variable assignment and then pass it to reset function:

$event_list = event_list(array('artikul_id' => $event_artikul_ids), ' AND point_id > 0');
$event = reset($event_list);

Same error in line 87 (needs if with braces though).

The problem in line 155 is caused by html_rating_div_str() function. For some reason it also requires reference - its definition might look like:

function html_rating_div_str(&$array, $users_data, $string) {...}

...with & before one of the variables. The referenced parameter should be changed to variable first, and then passed to this function.

PHP - Strict standards: Only variables should be passed by reference

Look at the end() signature: mixed end(array &$array). It expects a reference to an array but you provided the return value of a function instead. That is not permitted in strict mode.

$sql  = "INSERT INTO club_territories (`club_id`, `teritorije_id`) VALUES ";
foreach ($params['territories'] as $key => $territory) {
$sql .= "('" . $clubId . "', '" . $territory . "')";
$keys = array_keys($params['territories']);
if ($key == end($keys)) {
$sql .= ';';
} else {
$sql .= ',';
}
}
return $query = mysql_query($sql, $this->link);

PHP Strict Standards: Only variables should be passed by reference

First of all you need to explode $_SERVER['HTTP_IF_MODIFIED_SINCE'] with ";"
and than you can use it in array_shift function.

<?
$exploded = explode(";",$_SERVER['HTTP_IF_MODIFIED_SINCE']);
if ((isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && array_shift($exploded) == $gmt_mtime))
?>

Side Note: I don't know its a typo error or not, well u need to add one ending ")" in if condition as well otherwise you will get the PARSE ERROR.

Strict Standards: Only variables should be passed by reference on line 20

The variable needs to be passed by ref, your passing the output of a function.

$password = password_hash($_POST['password'], PASSWORD_BCRYPT);
$stmt->bindParam(':password', $password);

Would resolve the issue

http://php.net/manual/en/pdostatement.bindparam.php

Note the ampersand before the variable.



Related Topics



Leave a reply



Submit