Opened 12 years ago
Closed 12 years ago
#20953 closed defect (bug) (fixed)
Users with PHP 5.2.4 or lower will receive notice "wrong parameter count for debug_backtrace()"
Reported by: | swekitsune | Owned by: | nacin |
---|---|---|---|
Milestone: | 3.4.1 | Priority: | normal |
Severity: | normal | Version: | 3.4 |
Component: | Warnings/Notices | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
If you try to update Wordpress to 3.4 on a server using PHP 5.2.4 or lower, the user will receive the notice "wrong parameter count for debug_backtrace()". In the function "wp_debug_backtrace_summary" we can see that the usage of debug_backtrace looks like this:
$trace = debug_backtrace( false );
In PHP 5.2.4 or lower, debug_backtrace() doesn't accept any parameters – however, laters versions do.
For the time being, it is easily fixed (just remove "false") but a permanent fix should be sought for.
Attachments (1)
Change History (8)
#1
@
12 years ago
- Summary changed from function debug_backtrace() doesn't accept any parameters in PHP 5.2.4 or lower to Users with PHP 5.2.4 or lower will receive notice "wrong parameter count for debug_backtrace()"
#2
@
12 years ago
This means you are running SAVEQUERIES in production, or are generating queries with errors, which are both bad.
As a "permanent" fix we could A) conditionally call debug_backtrace() with either one or no arguments, and B) if we call it with no arguments, we'll need to ignore the object ourselves.
#3
follow-up:
↓ 4
@
12 years ago
- Milestone changed from Awaiting Review to 3.4.1
I think this actually generates an E_WARNING for PHP core functions, rather than E_NOTICE, so assigning to 3.4.1.
#4
in reply to:
↑ 3
@
12 years ago
- Cc kpayne@… added
- Keywords has-patch added
Replying to nacin:
I think this actually generates an E_WARNING for PHP core functions, rather than E_NOTICE, so assigning to 3.4.1.
Confirmed E_WARNING. Submitted 20953.patch for the following:
php < 5.2.5 = debug_backtrace php 5.2.5 to 5.3.5 = debug_backtrace(false) php 5.3.6+ = debug_backtrace(0)
false vs. 0 is semantics, but 0 emphasizes that it's a bitmask field.
#5
@
12 years ago
- Owner set to nacin
- Resolution set to fixed
- Status changed from new to closed
In [21113]:
Changed the title to be more descriptive.