PEAR causes error with E_STRICT and PHP5

Bug #79417 reported by hackel
2
Affects Status Importance Assigned to Milestone
php5 (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

Binary package hint: php-pear

When using PEAR with PHP5, I get the following error:

Strict standards: Assigning the return value of new by reference is deprecated in /usr/share/php/PEAR.php on line 563 / 566

On line 562 the reference & must be removed:

        if ($skipmsg) {
            $a = new $ec($code, $mode, $options, $userinfo);
            return $a;
        } else {
            $a = new $ec($message, $code, $mode, $options, $userinfo);
            return $a;
        }

After that, everything works and the error goes away.

Revision history for this message
hackel (hackel) wrote :

FYI using php-pear 5.1.6-1ubuntu2.1 on Edgy

Revision history for this message
Paul Dufresne (paulduf) wrote :

Well, I know almost nothing about PHP and Pear,
but I can confirm that in Gutsy, there is still $a = &new ... rather than $a = new ...

Seems complete enough for a developer to verify, so I am confirming this bug.

Changed in php5:
status: New → Confirmed
Revision history for this message
Till Klampaeckel (till-php) wrote :

This is not a bug, PEAR is PHP4 compatible. To not see those issues, adjust error_reporting in php.ini.

If you want PHP5.3+ code, please check out pyrus:
http://pear2.php.net/

Revision history for this message
Chuck Short (zulcss) wrote :

Gutsy is no longer supported so Im closing this bug. Its also probably fixed in natty or lucid so if you can still reproduce it on either of those two then please re-open the bug.

Changed in php5 (Ubuntu):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.