CodeIgniter Forums
Only variables should be assigned by reference - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Only variables should be assigned by reference (/showthread.php?tid=38165)



Only variables should be assigned by reference - El Forum - 02-01-2011

[eluser]skunkbad[/eluser]
Quote:An error occurred in script 'C:\xampp\htdocs\community-cart-v2\system\core\Controller.php' on line 51:
Only variables should be assigned by reference

If I take out the ampersand on line 51 of CI_Controller, then the error goes away, but what is triggering the error? I converted another site to V2.0 last night and it doesn't give the error.


Only variables should be assigned by reference - El Forum - 02-01-2011

[eluser]skunkbad[/eluser]
Actually, I found that the error was being shown as a result of a custom error handler set to E_ALL | E_STRICT. Maybe I'm wrong, but I thought that in php5 everything is passed by reference automatically, eliminating the need to use the =&. Am I wrong? Should all =& be changed in Reactor?