From:             info at netmosfera dot it
Operating system: irrelevant
PHP version:      5.3.0beta1
PHP Bug Type:     Class/Object related
Bug description:  override declaration with non type hinted params should allow 
type hinting

Description:
------------
hello

i think that non-type-hinted arguments (mixed values):

class a
{
     function test([mixed] $argument){}
}

should allow type hinting in child classes

class b extends a
{
     function test(ImageFile $argument){}
}

Reproduce code:
---------------
"mixed" is a general type... means "everything"
but if i want to build an ArrayObject object with one-only type

i cannot do this

[internal]
class ArrayObject implements ArrayAccess
{
      function offsetSet($o, [mixed] $value)
      {}
}

class ImageList extends ArrayObject
{
      function offsetSet($o, Image $imageObject) // fatal error!
      {}
}

Actual result:
--------------
Fatal error: Declaration of ImageList::offsetSet() must be compatible with
that of ArrayAccess::offsetSet() in xx on line 8

thank you

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

Reply via email to