Recent Topics

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

Started by on Jan 14, 2010 – Contents updated: 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 (


  • 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.


    $AdminUI = & new AdminUI();


    $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=]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


    I made a patch for this:

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

    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


    there could be this message:


    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:


    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...

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