Codeigniter Error core/Common.php Only variable references should be returned by reference

Published by

Posted on October 05, 2016

PHP 5.6 and Codeigniter error

A PHP Error was encountered

Severity: Notice

Message: Only variable references should be returned by reference

Filename: core/Common.php

Line Number: 257

– Fix
https://github.com/bcit-ci/CodeIgniter/commit/69b02d0f0bc46e914bed1604cfbd9bf74286b2e3

Edit line 257 of system/core/Commons.php
[php]
Replace return $_config[0] =& $config;

with
– return $_config[0] =& $config;
+ $_config[0] =& $config;
+ return $_config[0];
[/php]