On Thu, 26 Feb 2004, Timm Friebe wrote:
On Thu, 2004-02-26 at 01:38, Marcus Boerger wrote:
Hello Timm,
[...]
Should work #1, Bar::connect() adds an argument
No the sugnature is incompatible. An instance of Foo cannot be called
with Bar or Connector's connect() Signature. Hence Bar is
Marcus Boerger wrote:
Hello Timm,
i had the same expirience today too. And also for me it makes not much
sense. The constructor shouldn't check inheritance rules. And as a
consequence maybe interfaces shouldn't allow constructors.
Does inheritance include visibility rules? ;)
Andrey
--
PHP
At 03:28 26/02/2004, Derick Rethans wrote:
On Thu, 26 Feb 2004, Marcus Boerger wrote:
Hello Timm,
well for normal methods we must do that. The derived class must support the
same signature that the base class supports. In you example that would only
work if the derived method would have a
Hello Andrey,
Thursday, February 26, 2004, 1:08:19 PM, you wrote:
Marcus Boerger wrote:
Hello Timm,
i had the same expirience today too. And also for me it makes not much
sense. The constructor shouldn't check inheritance rules. And as a
consequence maybe interfaces shouldn't allow
[EMAIL PROTECTED]:~/devel/php/tests cat inheritance.php
?php
class Foo {
function __construct($foo) {
}
}
class Bar extends Foo {
function __construct($foo, $bar) {
// Add = NULL after $bar to make it work
}
}
?
[EMAIL PROTECTED]:~/devel/php/tests php-dev
Hello Timm,
i had the same expirience today too. And also for me it makes not much
sense. The constructor shouldn't check inheritance rules. And as a
consequence maybe interfaces shouldn't allow constructors.
marcus
Wednesday, February 25, 2004, 11:36:57 PM, you wrote:
[EMAIL
On Wed, 2004-02-25 at 23:44, Marcus Boerger wrote:
Hello Timm,
i had the same expirience today too. And also for me it makes not much
sense. The constructor shouldn't check inheritance rules.
Neither should other methods follow this. What if I want to add a
non-default parameter to an
Hello Timm,
well for normal methods we must do that. The derived class must support the
same signature that the base class supports. In you example that would only
work if the derived method would have a default parameter for the additional
parameter:
?php
class Foo {
function
On Wed, 2004-02-25 at 23:52, Timm Friebe wrote:
On Wed, 2004-02-25 at 23:44, Marcus Boerger wrote:
Hello Timm,
i had the same expirience today too. And also for me it makes not much
sense. The constructor shouldn't check inheritance rules.
Neither should other methods follow this.
On Thu, 2004-02-26 at 01:38, Marcus Boerger wrote:
Hello Timm,
[...]
Should work #1, Bar::connect() adds an argument
No the sugnature is incompatible. An instance of Foo cannot be called
with Bar or Connector's connect() Signature. Hence Bar is not a Foo
or Connector.
Hrm, that's quite a
Hello Timm,
Hello Zeev, please have a look at this thread. Obviously you started
a huge BC break here. See my second comment on a possible way out.
Thursday, February 26, 2004, 2:13:48 AM, you wrote:
On Thu, 2004-02-26 at 01:38, Marcus Boerger wrote:
Hello Timm,
[...]
Should work #1,
On Thu, 2004-02-26 at 02:13, Timm Friebe wrote:
On Thu, 2004-02-26 at 01:38, Marcus Boerger wrote:
Hello Timm,
[...]
Should work #1, Bar::connect() adds an argument
No the sugnature is incompatible. An instance of Foo cannot be called
with Bar or Connector's connect() Signature. Hence
On Thu, 2004-02-26 at 02:38, Marcus Boerger wrote:
Hello Timm,
[...]
Yes! Maybe it would be good to apply the correct rules with E_COMPILE_ERROR
in cases where interfaces come into play and E_STRICT for compatibility mode
and non interfaces. Would that work for you?
Yupp, that's perfect.
-
At 23:36 25/02/2004 +0100, Timm Friebe wrote:
[EMAIL PROTECTED]:~/devel/php/tests cat inheritance.php
?php
class Foo {
function __construct($foo) {
}
}
class Bar extends Foo {
function __construct($foo, $bar) {
// Add = NULL after $bar to make it work
}
}
?
[EMAIL
At 23:52 25/02/2004 +0100, Timm Friebe wrote:
On Wed, 2004-02-25 at 23:44, Marcus Boerger wrote:
Hello Timm,
i had the same expirience today too. And also for me it makes not much
sense. The constructor shouldn't check inheritance rules.
Neither should other methods follow this. What if I want
At 08:03 26/02/2004 +0100, Timm Friebe wrote:
On Thu, 2004-02-26 at 07:49, Andi Gutmans wrote:
At 23:36 25/02/2004 +0100, Timm Friebe wrote:
[...]
Guys,
You are breaking the isA relationship. We fixed this so that from now on,
people will not make such mistakes anymore (I think it's the right
16 matches
Mail list logo