From:             jonas at datatal dot se
Operating system: winxp sp2
PHP version:      5.0.2
PHP Bug Type:     Zend Engine 2 problem
Bug description:  Abstract functions and default parameter

Description:
------------
Don't know if this is a bug or a feature request. Any case, it's a Zend 2
problem..



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

abstract class DbClass
{
        protected $m_con;
        
        public function  __construct(ADOConnection $con)
        {
                $this->m_con = $con;
        }

        /** Factory method to create an object from the database */
        abstract public static function Get(ADOConnection $con, $id, $localeId);
}

class User extends dbClass
{
        public static function Get(ADOConnection $con, $id, $localeId = 1053)
        {
                
        }
        
}

?>

Expected result:
----------------
Should be possible to assign default values to parameters in overloaded
abstract functions.

Actual result:
--------------
Fatal error: Declaration of User::Get() must be compatible with that of
DbClass::Get() in d:\projects\inetpub\WebUser\test.php on line 23

-- 
Edit bug report at http://bugs.php.net/?id=30793&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=30793&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=30793&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=30793&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=30793&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=30793&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=30793&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=30793&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=30793&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=30793&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=30793&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=30793&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=30793&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=30793&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=30793&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=30793&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=30793&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=30793&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=30793&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=30793&r=mysqlcfg

Reply via email to