Error codeigniter / Common.php and database / DB.php

1

To try to open my DBO site but is giving this error can anyone help?

  

A PHP Error was encountered

     

Severity: Notice

     

Message: Only variables should be passed by reference

     

Filename: codeigniter / Common.php

     

Line Number: 148

     

A PHP Error was encountered

     

Severity: Notice

     

Message: Only variables should be passed by reference

     

Filename: database / DB.php   Line Number: 133

Common: line 148

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

DB: line 133

$DB =& instantiate_class(new $driver($params));
    
asked by anonymous 19.10.2017 / 21:02

1 answer

0

& was used in PHP4 to create objects, this attributed construct became obsolete in PHP5. To solve the problem just remove it.

Change:

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

To:

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

The same applies to $DB =& instantiate_class(new $driver($params));

Related:

Codeigniter 2 with variable reference error in PHP version 5.6

Using & next to Operators and Functions in PHP

    
20.10.2017 / 13:16