Welcome Guest, Not a member yet? Register   Sign In
Call-time pass-by-reference has been deprecated
#1

[eluser]phparif[/eluser]
I have following error :

A PHP Error was encountered
Severity: 8192
Message: Call-time pass-by-reference has been deprecated
Filename: libraries/DuetCS.php
Line Number: 55

My 55 line is:
while (preg_match("{\\b $rexProtocol $rexDomain $rexPort $rexPath $rexQuery $rexFragment (?=[?.!,;:\"]?(\s|$))}", $text, &$match, PREG_OFFSET_CAPTURE, $position)){}
#2

[eluser]InsiteFX[/eluser]
Remove the & from &$match
#3

[eluser]phparif[/eluser]
@Research Scientist, many many thanks.
#4

[eluser]Unknown[/eluser]
I am not getting proper results if I remove & from my code.

function getChildren($parent_id, $tree_string=array())

and calling it using $this->getChildren($val, &$tree_string);

getting an error as follows:

<div solid #990000;padding-left:20px;margin:0 0 10px 0;">

<h4>A PHP Error was encountered</h4>

<p>Severity: 8192</p>
<p>Message: Call-time pass-by-reference has been deprecated</p>
<p>Filename: controllers/team.php</p>
<p>Line Number: 111</p>

</div>

Because of this message, my json response is being malformed.

#5

[eluser]dmyers[/eluser]
This is not a error with CodeIgniter but more of the out dated code you are using.

In PHP you no longer pass by reference in the function call. by reference or by value is now setup in the function declaration.

my_function(&$bar); // Now incorrect in PHP

/* declare $bar is passed by reference */
my_function(&$bar) {
}

Hope that helps you understand what is happening.




Theme © iAndrew 2016 - Forum software by © MyBB