I’m getting this error on the commented line. Any idea why?
Fatal error: Call-time pass-by-reference has been removed in myfile.php on line 301
Call Stack
# Time Memory Function Location
1 0.0002 245352 {main}( ) ../plugins.php:0
2 0.3016 7149968 plugin_sandbox_scrape( ) ../plugins.php:156
Code is below…
function rseo_doTheParse($tag, $post){
//headings
$keyword = rseo_sanitize3(trim(strtolower(rseo_getKeyword($post))));
$content = rseo_sanitize3($post->post_content);
$match = 0;
$token = '/<'.$tag.'[^>]*>(.*\b'.$keyword.'\b.*)<\/'.$tag.'>/siU';
if(preg_match($token, &$content, $matches)) //THIS IS LINE 301
{
$match = 1;
}
return $match;
}
Remove the
&from&$content, which is the call time pass by reference.PHP has long supported passing arguments by reference; historically this has been possible to do either by declaring the function to receive an argument by reference:
or by using pass-by-reference at the call site:
The latter option has been removed in PHP 5.4, and this is the reason for the error.