On 07/Oct/10 8:56 AM, Nathan Nobbe wrote:
Hi,

Probly rehashing an old conversation here, but I'm wondering why the
following isn't supported

<?php
abstract class AbstractServer {}
class ConcreteServer extends AbstractServer {}

abstract class AbstractClient {
   abstract function doStuff(AbstractServer $o);
}

class ConcreteClient extends AbstractClient {
   function doStuff(ConcreteServer $o) {}
}
?>

Here's the problem:

    class ConcreteServer2 extends AbstractServer
    {}

Now, ConcreteClient can't receive an instance of ConcreteServer2 as an argument, although the initial hint, AbstractServer would have allowed it.

--
IonuČ› G. Stan  |  http://igstan.ro

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to