Edit report at http://pear.php.net/bugs/bug.php?id=12071&edit=1

ID: 12071
Comment by: uqwfung
Reported By: uqwfung at uq dot edu dot au
Summary: Error message: Assigning the return value of new by
reference is deprecated
Status: Closed
Type: Bug
Package: Mail
Operating System: arch linux
Package Version: 1.1.14
PHP Version: 5.2.4
Assigned To: chagenbu
New Comment:

E_DEPERCATED is something out of E_ALL I guess. The workaround is here:

In PHP script, I put this line right before including Mail.php:

//Temporarily suppressing PHP 5.3 deprecated error message like
Mail::factory assigning the return value of new by reference
error_reporting( E_ALL & ~( E_NOTICE | E_STRICT | E_DEPRECATED ) );
require_once "Mail.php";

With dynamic error_reporting() setting within particular PHP script, PHP
engine will suppress those messages of deprecated function call while
the global error_reporting level remains unchanged for further

Previous Comments:

[2011-02-02 04:46:48] hm2k

<div id="changeset">
<span class="removed">-Status: Wont fix</span>
<span class="added">+Status: Closed</span>
</div>Appears to have been fixed as per bug #16969...


[2010-02-02 04:50:01] jshpro2

Me too. I installed pear to install phing & phpunit. I am now
uninstalling your non-maintained framework for it's failure to keep up
with good standards :-)


[2010-01-08 02:44:31] hubbitus

In any case call nonstatic methods in static context is bad idea - it
will be prohibited in the future versions of PHP.


[2009-12-30 16:48:49] magnamel

Hi hubbitus,
thank your for your reply about my question
I have tried to call back the parseAddressList method in static manner.
I know that this is not correct but with a E_ALL & ~E_NOTICE error level
in php.ini the error is disappeared again.
The code in Mail.php is now the follow:

//$parser =& new Mail_RFC822();
$addresses = Mail_RFC822::parseAddressList($value, 'localhost', false);

Is this PHP4 compatible?



[2009-12-27 13:48:04] hubbitus

magnamel - there no problem removing this ampersand in PHP5 but it
breaks backward capability with php4. I can say must be removed for
PHP5. In easy way it may be wrapped to oark in both.


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
postedApr 8, '11 at 4:26a
activeApr 8, '11 at 4:26a

1 user in discussion

Uqwfung: 1 post



site design / logo © 2022 Grokbase