# Inconsistent behavior when using interfaces

- Thread: https://externals.io/message/29635
- Original archive: https://news-web.php.net/php.internals/29635
- Started by Ralph Schindler on 2007-05-21T19:32:27+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #29635 — Ralph Schindler — 2007-05-21T19:32:27+00:00

URL: https://externals.io/message/29635#29635

Is this a problem or not?

The following will produce this notice:

Strict Standards: Declaration of Z_Concrete::__get() should be 
compatible with that of Z_Abstract::__get() in xxx on line 16

<?php

error_reporting(E_ALL | E_STRICT);

interface Z_Interface
{ }

abstract class Z_Abstract implements Z_Interface
{
   public function __get($name)
   {
     return;
   }
}

class Z_Concrete extends Z_Abstract
{
   public function & __get($name)
   {
     return null;
   }
}

$t = new Z_Concrete();





This code will not produce a notice:

<?php

error_reporting(E_ALL | E_STRICT);

abstract class Z_Abstract
{
   public function __get($name)
   {
     return;
   }
}

class Z_Concrete extends Z_Abstract
{
   public function & __get($name)
   {
     return null;
   }
}

$t = new Z_Concrete();





The only difference is that the former has an interface as a parent, the 
latter does not.  Is this a bug?

-ralph

CONFIDENTIALITY NOTICE: This e-mail message, including any attachments,
is being sent by 3Com for the sole use of the intended recipient(s) and
may contain confidential, proprietary and/or privileged information.
Any unauthorized review, use, disclosure and/or distribution by any 
recipient is prohibited.  If you are not the intended recipient, please
delete and/or destroy all copies of this message regardless of form and
any included attachments and notify 3Com immediately by contacting the
sender via reply e-mail or forwarding to 3Com at postmaster@3com.com.

---

## #29646 — Marcus Boerger — 2007-05-21T21:55:42+00:00

URL: https://externals.io/message/29635#29646 · In reply to: #29635

Hello Ralph,

Monday, May 21, 2007, 9:32:27 PM, you wrote:

> Is this a problem or not?

> The following will produce this notice:

> Strict Standards: Declaration of Z_Concrete::__get() should be 
> compatible with that of Z_Abstract::__get() in xxx on line 16

> <?php

> error_reporting(E_ALL | E_STRICT);

> interface Z_Interface
> { }

> abstract class Z_Abstract implements Z_Interface
> {
>    public function __get($name)
>    {
>      return;
>    }
> }

> class Z_Concrete extends Z_Abstract
> {
>    public function & __get($name)
>    {
>      return null;
>    }
> }

> $t = new Z_Concrete();





> This code will not produce a notice:

> <?php

> error_reporting(E_ALL | E_STRICT);

> abstract class Z_Abstract
> {
>    public function __get($name)
>    {
>      return;
>    }
> }

> class Z_Concrete extends Z_Abstract
> {
>    public function & __get($name)
>    {
>      return null;
>    }
> }

> $t = new Z_Concrete();





> The only difference is that the former has an interface as a parent, the 
> latter does not.  Is this a bug?

yes

best regards
marcus


Now completely out of topic:
> CONFIDENTIALITY NOTICE: This e-mail message, including any attachments,
> is being sent by 3Com
bla bullshit nonsense

in the same manner i guess it makes no sense tocommunicate further? :-)

this is a general consideration, people should stop sending these non
applicable message stubs. They render open source unuseable.

Best regards,
 Marcus

---

## #29649 — Ralph Schindler — 2007-05-21T22:34:36+00:00

URL: https://externals.io/message/29635#29649 · In reply to: #29646

Marcus Boerger wrote:

 >
 > yes
 >

I will submit it to bugs.php.net

 >
 > in the same manner i guess it makes no sense tocommunicate further? :-)
 >
 > this is a general consideration, people should stop sending these non
 > applicable message stubs. They render open source unuseable.
 >

Yeah, as much as I agree, the only SMTP server available to me at the 
time of sending the message was over my work vpn connection, so I am at 
their discretion.  Coffeeshops, unfortunately, don't allow any outgoing 
port 25 traffic.  So oh well.

Thanks,
-ralph
