From:             oliver at teqneers dot de
Operating system: OpenSuSE 11.0
PHP version:      5.2.8
PHP Bug Type:     Scripting Engine problem
Bug description:  Strict standards: Declaration of ... should be compatible 
with that of ...

Description:
------------
If I turn on E_STRICT, I get a strict notice depending on class position.
The notice is as following:

Strict standards: Declaration of ... should be compatible with that of
...

Maybe this notice is correct, but if I switch the classes in my code
without changing their content, this notice is gone?!?

This is a problem when using autoload, because it might happen, that a
subclass is loaded before the parent class has been parsed.

Reproduce code:
---------------
<?php
// this code does trigger a strict message
error_reporting( E_ALL | E_STRICT );

class cc extends c {
  function test() { return null; }
}

class c {
  function test( $a ) { return 1; }
}
$cc     = new cc();
?>

<?php
// this code does NOT trigger a strict message
error_reporting( E_ALL | E_STRICT );

class c { 
  function test( $a ) { return 1; }
}

class cc extends c {
  function test() { return null; }
}

$cc     = new cc();
?>

Expected result:
----------------
None of the code blocks should trigger an error (my personal preference)
or both code blocks must trigger a notice.

Actual result:
--------------
First block triggers:
Strict standards: Declaration of cc::test() should be compatible with that
of c::test() in strict_test.php on line 4

Second does nothing at all.

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

Reply via email to