Recent Topics

Getting: Deprecated: Assigning the return value of new by re

started by on Jan 14, 2010 – Last touched: Jan 14, 2010

Jan 14, 2010 05:50    

Getting this error: "Deprecated: Assigning the return value of new by reference is deprecated in /blogs/admin.php on line 169"

When running a new installation of b2evolution 3.3.x using XAMPP 1.7.3a (http://www.apachefriends.org/en/xampp-linux.html).

[list]

  • Apache 2.2.14
  • MySQL 5.1.41
  • PHP 5.3.1 & PEAR + SQLite 2.8.17/3.6.16 + multibyte (mbstring) support
  • Perl 5.10.1
  • phpMyAdmin 3.2.4
  • [/list:u]

    Mar 08, 2010 22:45

    I've found that modifying the line 169 to change it from a reference to a literal assignment works.

    Code

    $AdminUI = & new AdminUI();
    to

    Code

    $AdminUI = new AdminUI();
    Not the best solution, but it seems to eliminate the problem, which came with the upgrade to 5.3.x which is the party that [url=http://php.net/manual/en/migration53.deprecated.php]deprecated assigning new as a reference [/url]. I suppose this may cause an increase in required memory, but I haven't notice any negligible consequences from the change.

    Mar 14, 2010 18:31

    Note: those notices appear in PHP 5.3 only.

    b2evolution 3.3.3 automatically disables those notifications if your PHP config allows it. If not, you can manually disable these notices in php.ini.

    b2evolution 4 removes all the = & new and replaces them with = new.

    Mar 14, 2010 22:10

    Hi.

    I made a patch for this:

    http://lukas-schauer.de/depr_new.patch

    or if you have "exec-rights" on the server you can use this php script in the root of your b2evolution installation:

    http://lukas-schauer.de/fix.php.txt

    the php-script should work with every php-application using "& new" in php-files but i wrote it just for b2evolution so no warranty on this :-P

    Edit:

    there could be this message:

    Code

    patching file skins/BlogIt/_feedback.php
    Hunk #1 FAILED at 91.
    1 out of 1 hunk FAILED -- saving rejects to file skins/BlogIt/_feedback.php.rej

    don't worry it's just because i had installed the BlogIt-skin while creating the patch

    Mar 16, 2010 18:40

    If you can edit your php.ini file (and you are able to find it), modify the error_reporting directive:

    Code

    error_reporting  =  E_ALL & ~E_NOTICE & ~E_DEPRECATED

    On most standard installations of php, you'll just need to add the "& ~E_DEPRECATED" to the end of the directive value. This is the manual way to change the level of error reporting without core hacking.


    Form is loading...

    powered by b2evolution – This forum is powered by b2evolution CMS, a complete engine for your website.