If you run PHP 5.3.0 with notices turn on you get a flurry of notices with every page load about errors in common.inc.
Notice: Undefined offset: 8192 in T:\home\clist.d6\public_html\includes\common.inc on line 602
Notice: Undefined offset: 8192 in T:\home\clist.d6\public_html\includes\common.inc on line 609The fix: In common.inc, on line 581, the line that reads:
$types = array(1 => 'error', 2 => 'warning', 4 => 'parse error', 8 => 'notice', 16 => 'core error', 32 => 'core warning', 64 => 'compile error', 128 => 'compile warning', 256 => 'user error', 512 => 'user warning', 1024 => 'user notice', 2048 => 'strict warning', 4096 => 'recoverable fatal error');
should read (as per http://ca2.php.net/manual/en/errorfunc.constants.php ):
$types = array(1 => 'error', 2 => 'warning', 4 => 'parse error', 8 => 'notice', 16 => 'core error', 32 => 'core warning', 64 => 'compile error', 128 => 'compile warning', 256 => 'user error', 512 => 'user warning', 1024 => 'user notice', 2048 => 'strict warning', 4096 => 'recoverable fatal error', 8192=> 'use of deprecated functions', 16384=>'use of deprecated user code');
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | error_bitmask-524664-17.D6.patch | 1.27 KB | roball |
Comments
Comment #1
Erich Schulz commentedThanks yes I concur! only the fix is on line 591 in 6.13!
i was just about to hack this on my local install, and a google for the php error codes brought me here!! perfect!
Comment #2
codecowboy commentedHere is a patch.
Comment #4
mfbE_DEPRECATED will not be defined in PHP 5.2, so using these new constants should be conditional.
Comment #6
webchickCommitted to HEAD. Looks like exists in 6.x as well. Doesn't apply cleanly, though, so needs porting.
Comment #7
cburschkaThis also exists in Drupal 5, though I can't remember if 5.x is supposed to support PHP 5.3+.
Since Drupal 5 does not use the PHP-defined bitmask constants, the unconditional change in the original post works just fine.
Comment #8
cburschkaNote that in D6, Drupal will actually define the E_DEPRECATED bitmask if it does not exist. However, it doesn't actually use the bitmask when making the type array.
In particular, it has an odd condition there:
Comment #9
summit commentedOriginal fix worked well for me! thanks!
greetings, Martijn
Comment #10
ñull commentedsubscribing and bump
Comment #11
brianfeister commentedThis fixed worked PARTIALLY for me. Changing this code caused the error to go away for logged-in users, but it is still visible to non-logged-in users. How can I get rid of the error for them as well?
Comment #12
webchickOne reason it might be showing for non-logged in users because page caching is enabled. Try clearing the cache and see if that fixes it.
Comment #13
webchickAlso, setting back to 6.x-dev. 5.x is no longer supported.
Comment #14
roball commentedThis problem does not exist in the current D6 release.
Comment #15
roball commentedSorry, no - the problem DOES actually still exist in Drupal 6, affecting PHP versions < 5.3, where E_DEPRECATED is not defined.
Comment #16
roball commentedThe attached patch fixes the bug. Also correcting this issue's title for Drupal 6. The only problem in D6 is that PHP versions < 5.3 would trigger the E_NOTICE message Use of undefined constant E_DEPRECATED.
Comment #17
roball commentedAttached is the same patch as in #16 above, but with an added comment as requested in #1954296: Restore original D6 behaviour to prevent logging E_STRICT warnings.
Comment #18
NaX commentedComment #19
roball commentedSure that nowadays there is no more deep focus on D6, but is there any chance the reviewed patch from #17 will be committed to 6.x ?