Opened 4 years ago
Closed 3 years ago
#10533 closed defect (bug) (fixed)
Php 5.3 deprecated errors
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 2.9 |
| Component: | Warnings/Notices | Version: | 2.9 |
| Severity: | normal | Keywords: | has-patch commit tested |
| 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)
comment:1
follow-up:
↓ 2
Denis-de-Bernardy — 4 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.)
yeah... can you write the patch? it shouldn't be too hard, if you base it on what things look like after r11128.
- 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.
- 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..
- 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 :-)
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);
comment:10
nacin — 3 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?
comment:11
nacin — 3 years ago
- Keywords tested added
Been applying this patch to wp-settings.php after svn checkouts for weeks, otherwise WP is unusable in PHP > 5.3 with WP_DEBUG.
comment:12
azaozz — 3 years ago
- Resolution set to fixed
- Status changed from accepted to closed

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.