Bug #51826 [Opn->Dup]: maybe a wrong oop logic.
| From: | aharvey@php.net | Date: | Tue, 03 Jul 2012 00:34:44 +0000 |
| Subject: | Bug #51826 [Opn->Dup]: maybe a wrong oop logic. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-171703@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=51826&edit=1
ID: 51826
Updated by: aharvey@php.net
Reported by: 1000235409 at smail dot shnu dot edu dot cn
Summary: maybe a wrong oop logic.
-Status: Open
+Status: Duplicate
Type: Bug
Package: Class/Object related
Operating System: WINDOWS
PHP Version: 5.3SVN-2010-05-14 (SVN)
Block user comment: N
Private report: N
New Comment:
Duplicate of bug #43200, which has now been fixed, as you've noted.
Previous Comments:
------------------------------------------------------------------------
[2012-07-02 13:13:27] j dot henge-ernst at interexa dot de
Seems to be fix with PHP 5.3.9
------------------------------------------------------------------------
[2010-05-22 16:21:23] 1000235409 at smail dot shnu dot edu dot cn
<?php
abstract class TAbstractParam {
protected $FValue = null;
public abstract function getType(); //getType
public function Dump() {
return "TYPE=" . $this->getType() . " VALUE=" . $this->FValue;
}
}
interface IParam {
public function getType(); //getType again.
}
class TStringParam extends TAbstractParam implements IParam {
public function getType() {return 'VARCHAR'; } //another getType, the fatal
error goes here.
}
see this example, please...
------------------------------------------------------------------------
[2010-05-18 01:35:34] 1000235409 at smail dot shnu dot edu dot cn
there are other non-abstract methods inside the abstract class to provide some base behaviors for
its children claclasses, which i omitted in this example. and those non-abstract methods may call
the abstract methods. and an abstract class should not be defdefined as an instance cclass for an
interface cuz an non-abstract one should, so why ambiguity?
------------------------------------------------------------------------
[2010-05-17 19:51:45] crrodriguez at opensuse dot org
Expected behaviour, your code causes ambiguity.
------------------------------------------------------------------------
[2010-05-14 17:42:35] 1000235409 at smail dot shnu dot edu dot cn
I have adapted those code(see it below) into delphi(object pascal, on
Delphi2010), however, nothing wrong at all. so i think it should be a wrong oop
logic in php5(5.2 included also, since i've tested then...)
Type
TAbstractParam = Class(TInterfacedObject)
Procedure getType(); Virtual; Abstract;
End;
IParam = Interface
Procedure getType();
End;
TPrimativeParam = Class(TAbstractParam, IParam)
Procedure getType();
End;
//Other code omitted...
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=51826
--
Edit this bug report at https://bugs.php.net/bug.php?id=51826&edit=1