Strict Standards: Only variables should be assigned by reference PHP 5.4

后端 未结 2 1994
醉酒成梦
醉酒成梦 2020-11-30 06:59

I upgraded my PHP version to 5.4 (XAMPP 1.7.3 to 1.8.0). Now I see Strict Standards error, for myDBconnection:

Strict Standards: On

相关标签:
2条回答
  • 2020-11-30 07:48

    You should remove the & (ampersand) symbol, so that line 4 will look like this:

    $conn = ADONewConnection($config['db_type']);
    

    This is because ADONewConnection already returns an object by reference. As per documentation, assigning the result of a reference to object by reference results in an E_DEPRECATED message as of PHP 5.3.0

    0 讨论(0)
  • 2020-11-30 07:51

    It's because you're trying to assign an object by reference. Remove the ampersand and your script should work as intended.

    0 讨论(0)
提交回复
热议问题