Only variable references should be returned by reference - Codeigniter
Edit filename: core/Common.php, line number: 257
Before
return $_config[0] =& $config;
After
$_config[0] =& $config;
return $_config[0];
Update
Added by NikiC
In PHP assignment expressions always return the assigned value. So $_config[0] =& $config returns $config - but not the variable itself, but a copy of its value. And returning a reference to a temporary value wouldn't be particularly useful (changing it wouldn't do anything).
Update
This fix has been merged into CI 2.2.1 (https://github.com/bcit-ci/CodeIgniter/commit/69b02d0f0bc46e914bed1604cfbd9bf74286b2e3). It's better to upgrade rather than modifying core framework files.
CodeIgniter Error: variable references
Try this one:
Change it in your Common.php
if (count($replace) > 0){
foreach ($replace as $key => $val){
if (isset($config[$key])){
$config[$key] = $val;
}
}
}
$_config[0] =& $config;
return $_config[0];
See also here , for more reference : Only variable references should be returned by reference - Codeigniter . I hope this helps.
Only variable references should be returned by reference - Codeigniter
Edit filename: core/Common.php, line number: 257
Before
return $_config[0] =& $config;
After
$_config[0] =& $config;
return $_config[0];
Update
Added by NikiC
In PHP assignment expressions always return the assigned value. So $_config[0] =& $config returns $config - but not the variable itself, but a copy of its value. And returning a reference to a temporary value wouldn't be particularly useful (changing it wouldn't do anything).
Update
This fix has been merged into CI 2.2.1 (https://github.com/bcit-ci/CodeIgniter/commit/69b02d0f0bc46e914bed1604cfbd9bf74286b2e3). It's better to upgrade rather than modifying core framework files.
How to fix Notice: Only variable references should be returned by reference in
Based on the notice you get and on an answer to another related question:
In PHP assignment expressions always return the assigned value. So
$_config[0] =& $config returns $config - but not the variable itself,
but a copy of its value. And returning a reference to a temporary
value wouldn't be particularly useful (changing it wouldn't do
anything).
Changing your code from:
return new BEncode_End();
To:
$cl = new BEncode_End();
return $cl;
Should solve your problem.
Only variables should be assigned by reference with function
Please see this url
https://github.com/bcit-ci/CodeIgniter/issues/904
You can go to file: system/core/Loader.php
Thenfile: system/core/Common.php
Line 190 there should be:
function &is_loaded($class = '')
changes core/Common.php results net::ERR_TOO_MANY_REDIRECTS
in core/Common.php
add this line on line no 257
return $_config[0];
i have try it its working for me when i upgraded my codeigniter version
Related Topics
How to Install/Enable the PHP Phar Extension
Call a C Program from PHP and Read Program Output
Executing Multiple SQL Queries in One Statement with PHP
Executing a Shell Script in Background with PHP
Package 'Php5-Gd' Has No Installation Candidate
Can't Install PHP Package on Centos
Naming Convention Issues When Using Codeigniter in Windows and Linux
Why We Need Curlopt_Ssl_Verifypeer in Windows
How to Check If There Is a There Is a Wget Instance Running
PHP Failed to Open Stream: Is a Directory
Centos 7/Apache/PHP - Mkdir(): Permission Denied
Execute Commands on Remote MAChine via PHP
How to Add Text to an Image with PHP Gd Library
The Post Method Is Not Supported for This Route. Supported Methods: Get, Head. Laravel
MySQL - Couldn't Connect Unknown Database 'Databasename' Error