php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #17360 No multiple inheritance possible
Submitted: 2002-05-22 09:39 UTC Modified: 2002-05-22 14:30 UTC
From: janfolkert at movenext dot nl Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.2.1 OS: Linux
Private report: No CVE-ID: None
 [2002-05-22 09:39 UTC] janfolkert at movenext dot nl
I don't know if this is in the right spot, but there seemed
to be no other way to send in requests, so here goes:
-----------------------------------------------

I noticed it's not possible to do multiple inheritance other
than doing the following:

class c extends b
{
}

class b extends a
{
}

class a
{
}
This is a bit too limiting for my taste, as you can only 
really inherit from 1 non-user-defined class, which is the
top one. The rest, you'll have to create yourself.
This can be quite annoying, especially when you have various
other classes which you have no write-access to to modify
so they extend another class.
What i'd like to do is:

class a extends b extends c
{
}

This would enable the programmer to inherit as many classes
as he/she wants, and not be fooling around with millions of
subclasses, which in turn require other subclasses, making
for some very long (and weird) spaghetti-like-programming..

Also, what could be ideal, is variable (multiple) class
inheritance:

class a extends $b extends $c
{
}

where $b and $c are variables defined at run-time. This
would make (for example) the creation of database-wrappers
and various other types of interfaces a LOT easier, though
it'll probably be a pain to implement into PHP, even if it's
at all possible.......:(

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-05-22 14:30 UTC] sniper@php.net
There already is a request for this. (search the bug db before sending any reports!!)

And this _might_ be in ZE2. (PHP 5)


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 03 07:01:33 2024 UTC