In Codeigniter controller I have this statement:
$txt = str_replace($t, $bracketted_var, $txt, &$count);
$count variable is passed by reference and I'm using it's changed value later in program.
Discovered that on new installation with PHP/5.3.3-7 calling that controller gives me in Firefox this response:
The connection to the server was reset while the page was loading
Without any log entry in Apache access log. In Error log I noticed two entries: [Mon Aug 26 12:12:28 2013] [notice] child pid 32048 exit signal Segmentation fault (11) [Mon Aug 26 12:12:28 2013] [notice] child pid 32082 exit signal Segmentation fault (11)
I tried a couple of other browsers and Androind and iPhone too without getting a web page content.
The statement wasn't in the function that was called. It looks like some kind of syntax error arise during parsing php file.
Searching for a solution I discovered that this str_replace statement doesn't give that error:
$txt = str_replace($t, $bracketted_var, $txt, $count);
I did temporarily make change so that other parts of controller are working. But I need to use a changed $count variable with a number of changes. Any suggestions?
Searching I didn't find anything usefull about such an error.
Call time pass by refernence is deprecated (in PHP > v5.3, it's utterly removed in v5.4 at which point it'll raise a fatal error). You can leave it as you have it now, $count
should be updatet as it is denoted as a reference by the str_replace
itself.
see http://php.net/manual/en/function.str-replace.php and http://php.net/manual/en/language.references.pass.php