Bug #18530 Updated: Request for Delphi style "inherited" call
| From: | alan at akbkhome dot com | Date: | Wed, 24 Jul 2002 08:37:21 +0000 |
| Subject: | Bug #18530 Updated: Request for Delphi style "inherited" call | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-15013@lists.php.net to get a copy of this message | ||
ID: 18530
Updated by: alan@akbkhome.com
Reported By: woprog@hotmail.com
Status: Won't fix
Bug Type: Feature/Change Request
Operating System: Any
PHP Version: 4.1.2
New Comment:
http://www.php.net/manual/en/keyword.parent.php
Previous Comments:
------------------------------------------------------------------------
[2002-07-24 04:35:21] derick@php.net
You can have a class named parent, but you can not access it as a
static class:
Derick
------------------------------------------------------------------------
[2002-07-24 04:27:55] woprog@hotmail.com
Hmm is that anywhere in the documentation? That also means that classes
with the name "parent" are not possible right?
Thanks a lot!!
------------------------------------------------------------------------
[2002-07-24 04:22:10] alan_k@php.net
you can already do
parent::foo();
the inherited; is really against the grain of the language as it is a
little too obfusicated.
------------------------------------------------------------------------
[2002-07-24 04:11:44] woprog@hotmail.com
This is a feature request, not a bug.
=====================================
Check the following code:
class A {
function foo() { echo "A bar"; }
}
class B extends A {
function foo() { echo "B bar"; }
}
When I want to call the parent version of the function foo() in B, I
have to enter:
A::foo();
thus including the actual classname of its parent... for me this is
really annoying (I work a lot with classes in PHP)... could it be
possible that the Delphi style of calling some classes parent version
of some function is included in PHP? In Delphi this would look like
this:
type
A = class
function foo();
end;
B = class(A)
function foo();
end;
function A.foo()
begin
// do something
end;
function B.foo()
inherited; // would call A.foo
// do something else
end;
As you can see in the Delphi code, there's no need to include the
actual class name in the call. This is possible since Delphi doesn't
support multiple inheritance. And as far as I know, PHP doesn't as
well, so it should be possible, right?
Would be really great to get feedback on this...
Marc
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18530&edit=1