how to do about "Assigning the return value of new by reference is deprecated?"

how to do about "Assigning the return value of new by reference is deprecated?"

by 燕珊 吴 -
Number of replies: 3

I am using moodle 1.9.9. How to do about "Assigning the return value of new by reference is deprecated?" when I add resource to the theme  list.

Average of ratings: -
In reply to 燕珊 吴

Re: how to do about "Assigning the return value of new by reference is deprecated?"

by Guillermo Madero -

Update to the latest 1.9 version or, if you can, use PHP version 5.2.17 instead of the one you are currently using (5.3.x).

If you can't or don't want to do neither of those options, you could try and add mask & ~E_DEPRECATED to the error_reporting parameter in the PHP configuration file (php.ini):

error_reporting( E_ALL & ~E_DEPRECATED );

In reply to Guillermo Madero

回复: Re: how to do about "Assigning the return value of new by reference is deprecated?"

by 燕珊 吴 -

thanks ,Guillermo Madero S. but I am sorry that,whether can I remove the ";" before the line followed:

; error_reporting
;   Default Value: E_ALL & ~E_NOTICE
;   Development Value: E_ALL | E_STRICT
;   Production Value: E_ALL & ~E_DEPRECATED

In reply to 燕珊 吴

Re: 回复: Re: how to do about "Assigning the return value of new by reference is deprecated?"

by Guillermo Madero -

No, those are just informative comments. As mentioned in the comment you found, for a production site the error_reporting directive should be set to E_ALL & ~E_DEPRECATED.

You should look a bit further in the file (under the "Error handling and logging" section) for the error_reporting directive and set it as recommended:

error_reporting = E_ALL & ~E_DEPRECATED