ID:               30793
 Updated by:       [EMAIL PROTECTED]
 Reported By:      jonas at datatal dot se
-Status:           Open
+Status:           Assigned
-Bug Type:         Zend Engine 2 problem
+Bug Type:         Feature/Change Request
 Operating System: winxp sp2
 PHP Version:      5.0.2
-Assigned To:      
+Assigned To:      andi
 New Comment:

Well, personally I do not think such features could be accepted.
You get these errors because method signatures are different (number of
required arguments and class hint differ), so this is well expected
behaviour.

I'm leaving this report as feature request for Andi.


Previous Comments:
------------------------------------------------------------------------

[2004-11-15 13:59:28] jonas at datatal dot se

Another related problem.

have this function in the same abstract class:

/** Fill the object with the information fetched from the db */
abstract public static function Fill(ADORecordset $rs, DbClass $db);

Since all db classes extends the DbClass this should be valid:

(in the user class)
public static function Fill(ADORecordset $rs, User $usr)
{
  [...]
}

but it isnt. I get the following error:

Fatal error: Declaration of User::Fill() must be compatible with that
of DbClass::Fill() in d:\projects\inetpub\WebUser\Classes\User.php on
line 83

------------------------------------------------------------------------

[2004-11-15 13:48:28] jonas at datatal dot se

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 this bug report at http://bugs.php.net/?id=30793&edit=1

Reply via email to