Opened 16 years ago
Closed 15 years ago
#10533 closed defect (bug) (fixed)
Php 5.3 deprecated errors
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.9 | Priority: | normal |
Severity: | normal | Version: | 2.9 |
Component: | Warnings/Notices | Keywords: | has-patch commit tested |
Focuses: | Cc: |
Description
There was a ticket #8701 that was meant to look at this, and it was marked as fixed 3 months ago. Yet today if I load up trunk in PHP5.3 with wp_debug on I get
PHP Deprecated: Assigning the return value of new by reference is deprecated in E:\webpage\svn\trunk\wp-includes\cache.php on line 103 PHP Deprecated: Assigning the return value of new by reference is deprecated in E:\webpage\svn\trunk\wp-includes\pomo\mo.php on line 171 PHP Deprecated: Assigning the return value of new by reference is deprecated in E:\webpage\svn\trunk\wp-includes\l10n.php on line 407 PHP Deprecated: Assigning the return value of new by reference is deprecated in E:\webpage\svn\trunk\wp-includes\query.php on line 61 PHP Deprecated: Assigning the return value of new by reference is deprecated in E:\webpage\svn\trunk\wp-includes\theme.php on line 1133 PHP Deprecated: Assigning the return value of new by reference is deprecated in E:\webpage\svn\trunk\wp-includes\taxonomy.php on line 617 PHP Deprecated: Assigning the return value of new by reference is deprecated in E:\webpage\svn\trunk\wp-includes\widgets.php on line 320
Many of which I guess relate to the use of $foo = & new bah.
But anyway, I look back through that ticket and I see that & ~ E_DEPRECATED was played with a few times, but the final commit never bothered with it. Should we not have an & ~ E_DEPRECATED in there somewhere? Otherwise I can't see a way around the error reports.
(I didn't re-open the last ticket as it is old and long.)
Hoping this is one of the first things to change once PHP4 support goes.
Attachments (2)
Change History (14)
#2
in reply to:
↑ 1
@
16 years ago
Replying to Denis-de-Bernardy:
Mm... WP_DEBUG would use E_ALL. Maybe it should be using E_ALL & ~ E_DEPRECATED & ~ E_STRICT though, depending on if those defines are around.
It would be helpful, because otherwise it is currently impossible to test on IIS & PHP5.3 with wp_debug, because you're halted by deprecation warnings. (Which will of course be around until core moves onwards.)
#3
@
16 years ago
yeah... can you write the patch? it shouldn't be too hard, if you base it on what things look like after r11128.
#4
@
16 years ago
- Keywords has-patch added; needs-patch removed
Attached a stab at it that works for me against PHP5.3. Removes deprecated warnings but still allows other issues through.
#6
follow-up:
↓ 8
@
15 years ago
- Keywords dev-feedback commi added
Can we please get this fixed(Well.. Deprecated warnings hidden)?
I have to hack it in every SVN checkout i make, because its impossible to override it otherwise..
#8
in reply to:
↑ 6
@
15 years ago
- Owner set to westi
- Status changed from new to accepted
Replying to dd32:
Can we please get this fixed(Well.. Deprecated warnings hidden)?
I have to hack it in every SVN checkout i make, because its impossible to override it otherwise..
I'll look at this.
After the joys I had with this before I'm going to get 5.3 installed somewhere first though :-)
#9
@
15 years ago
After the joys I had with this before I'm going to get 5.3 installed somewhere first though :-)
Luckily it installs nearly anywhere just as easily as PHP 5.2 did now :)
For the record, All i've been doing is modifying it to this: (on PHP 5.3), I've not once seen anything related to E_STRICT yet.
error_reporting(E_ALL & ~E_DEPRECATED);
#10
@
15 years ago
- Keywords dev-feedback removed
Patch attached - hybrid of what's been posted. If WP_DEBUG, check if E_DEPRECATED is defined and exclude it if it is. E_STRICT is not part of E_ALL in PHP < 6.
I think we're good to commit this?
Mm... WP_DEBUG would use E_ALL. Maybe it should be using E_ALL & ~ E_DEPRECATED & ~ E_STRICT though, depending on if those defines are around.
D.