Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only variables should be passed by reference /system/codeigniter/Common.php #5224

Closed
alexmason528 opened this issue Aug 16, 2017 · 6 comments

Comments

@alexmason528
Copy link

I have upgrade php version to 7.0.22 and this error happens.

@gxgpet
Copy link
Contributor

gxgpet commented Aug 16, 2017

Tell us which line of Common.php is causing this and what CI version are you using.

@devravi
Copy link

devravi commented Oct 4, 2017

I was upgrading codeigniter application from 2.1.x to 3.1.6,
I'm receiving same error on line number: 257.
My Php version is 5.6

@zploskey
Copy link
Contributor

zploskey commented Oct 4, 2017

You need to replace your system folder. This file has been moved to system/core/Common.php, so you must be using an old version. Follow the upgrading section in the user guide.

@narfbg narfbg closed this as completed Oct 4, 2017
@milyas77
Copy link

milyas77 commented Feb 5, 2018

i was facing Notice: Only variables should be passed by reference in C:\xampp\htdocs\pos\system\codeigniter\core\Common.php on line 148

i don't know how to fix it
and line no 148 is:
$objects[$class] =& instantiate_class(new $name());

@u01jmg3
Copy link

u01jmg3 commented Mar 8, 2019

$objects[$class] =& instantiate_class(new $name());

Is the same as writing:

$objects[$class] =& new $name();

Which is the way that it needed to be written to glue PHP 4 with PHP 5.3 code because it prevented strict standard warnings in PHP 5.3.

Now this can be written as:

$objects[$class] = new $name();


https://stackoverflow.com/questions/7653709/codeigniter-instantiate-class-function#answer-7653853

@narfbg
Copy link
Contributor

narfbg commented Mar 11, 2019

instantiate_class() hasn't existed in CI since version 2.0.0 ... We're at 3.1.10 now.

In case it wasn't clear when I closed the issue, @zploskey answered it appropriately - if you get this error, it means you've screwed up an update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants