From:             tomek at realtsp dot com
Operating system: FreeBSD 7.0, Ubuntu
PHP version:      5.2.9RC2
PHP Bug Type:     Compile Warning
Bug description:  Strict errors don't always appear in CLI

Description:
------------
When running in CLI with strict errors enabled & display_errors turned on,
PHP does not produce all strict warnings reliably.

Some, like:

"Strict Standards: Non-static method b::init() should not be called
statically in /usr/home/tomek/test.php on line 25"

is 100% reproducible.

Others, like:

"Strict Standards: Declaration of b::init() should be compatible with that
of a::init() in /usr/home/tomek/test.php on line 8"

are not reproducible using the code attached. Swapping the class
declarations, however, makes the warning appear (ie. "class b extends a"
goes first, and only then define "class a").

Please note that this is the *only* change required for it to appear. 

This is very similar to bug #46851.

Reproduce code:
---------------
<?php

error_reporting(E_ALL | E_STRICT);

ini_set('display_errors', 'On');
ini_set('log_errors', 'Off');

class a
{
  public function init($v) {}
}

class b extends a
{
  public function init() {}
}

b::init();

Expected result:
----------------
Strict Standards: Declaration of b::init() should be compatible with that
of a::init() in /usr/home/tomek/test.php on line 8

Strict Standards: Non-static method b::init() should not be called
statically in /usr/home/tomek/test.php on line 19


Actual result:
--------------
Strict Standards: Non-static method b::init() should not be called
statically in /usr/home/tomek/test.php on line 19

-- 
Edit bug report at http://bugs.php.net/?id=47439&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=47439&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=47439&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=47439&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=47439&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=47439&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=47439&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=47439&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=47439&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=47439&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=47439&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=47439&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=47439&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=47439&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=47439&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=47439&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=47439&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=47439&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=47439&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=47439&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=47439&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=47439&r=mysqlcfg

Reply via email to