Skip to main content Help Control Panel

Login   A+   A-

Development «   To be integrated «  

A workaround for "Notice: Only variable references should be returned by reference in"

Posted by Simplify3 on Jul. 2 2007, commented by Simplify3 on Jul. 4 2007, (popular)  
Rate this page

Get this error when using verbose output? Try this.
An example is in UTF8.php.

At the end, where it says: return $output; [line 883]

change it to this:

//return $output; [comment it out]

and add:

$a=$output; return a$;

This turns it into a variable reference and it stops complaining.

Thoughts?
Bernard
avatar
from nearby-an-airport
Associate
6406 posts
registered on Sep. 12 2003

on Jul. 3 2007


The general approach is ok, but in my opinion this does not apply to the line 883 of shared/utf8.php, since $output is set a couple of lines above... Maybe at other locations?
Simplify3
avatar
Member
44 posts
registered on June 3 2007

on Jul. 4 2007


Well, the workaround is for where it says, "return $output; - maybe it wasn't line 883 - but for some reason, PHP thinks that $output is a static reference , a constant, but when assigning the value of $output to a brand new variable, which I called $a just to keep it simple for now - it seemed to like that.

It really wasn't a problem - this error message, as it only showed up when I was in debug mode. I was just happy to find a fix for it for what is probably a weird scenerio at my host provider, freehostia.com.