I have created a plugin that is running good in PHP v5.5.x. When I upgrade my PHP version to 7.x it gives me errors.
Code that is suspicious is:
$this->EE =& get_instance();
Error is:
only variables should be passed by reference
ExpressionEngine® Answers is a question and answer site for administrators, end users, developers and designers for ExpressionEngine® CMS. It only takes a minute to sign up.
Sign up to join this communityAs error says, PHP 7 is only allow variables to passed by reference not an instance. You now need to remove that line and replace all $this->EE
calls to ee()
. That will work for you.
ee()
. However I was looking for workaround with $this->EE
.
May 16, 2017 at 12:50
Pretty sure you don't need this in a plugin `$this->EE =& get_instance(); ref https://docs.expressionengine.com/v2/development/plugins.html
$this->EE
instead of ee()
call
May 16, 2017 at 12:53