I have a CodeIgniter 3 application that cannot be converted to CI4 or anything else for that matter given that it is a large application of over 2 million lines of code, is a business critical system, andthere is no budget or time to do this right now. I therefore need a solution other than instead of “Upgrade your platform” or “Use a different platform”, please 🙂
Here is the problem:
In CodeIgniter 3, the function get_instance() is declared by reference:
function &get_instance()
{
return CI_Controller::get_instance();
}
We are getting this error on PHP 8.0.27 (it is not our production server – that is on PHP 8.1, we’re trying to test the waters on a test server before going to 8.2 on production):
Notice: Only variables should be assigned by reference in
--------/views/errors/html/error_php.php on line 80
Some part of our code is broken, and our error handler is triggered, which bombs out in this case (original error is not shown – only the error that occurs in the error handler). Our error handler is obviously borked, which I am trying to resolve. It appears at the time this error occurs that the CI super object seems to be not available.
Solving the error that triggers the error handler would make this go away for this particular case, but is not a solution, because the next error that occurs will just bring it back, so hopefully someone has a solution to the fact that CI uses function &get_isntance() declaration which our PHP version does not like, preferably in such a way that I do not have to retrofit an entire 2 million line codebase (right now).