# Bug: Can't inherit abstract function

- Thread: https://externals.io/message/13247
- Original archive: https://news-web.php.net/php.internals/13247
- Started by Timm Friebe on 2004-10-09T13:26:24+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

---

## #13247 — Timm Friebe — 2004-10-09T13:26:24+00:00

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

Hi,
the attached script produces:

Fatal error: Can't inherit abstract function Drawable::draw()
(previously declared abstract in Figure) in /usr/home/thekid/r.php on
line 12

which is wrong because I am not inheriting anything but implementing an
interface.

The problem is that both zend_do_inheritance() *and*
zend_do_implement_interface() use (merge_checker_func_t)
do_inherit_method_check.

Want me to open a bug report?

- Timm

---

## #13248 — Timm Friebe — 2004-10-09T13:32:42+00:00

URL: https://externals.io/message/13247#13248 · In reply to: #13247

> Hi,
> the attached script produces:
[...Error message...]

-       if (parent->common.fn_flags & ZEND_ACC_ABSTRACT
+       if (!(parent->common.scope->ce_flags & ZEND_ACC_INTERFACE)
+               && parent->common.fn_flags & ZEND_ACC_ABSTRACT

fixes the problem.

- Ti "likes to talk to himself" mm

---

## #13261 — Andi Gutmans — 2004-10-11T22:09:39+00:00

URL: https://externals.io/message/13247#13261 · In reply to: #13247

What do you expect to happen?
BTW, I see an additional problem. You aren't supposed to be able to use 
access modifiers such as public/abstract in an interface definition. This 
is something we have to fix.
It should be:
   interface Drawable {
    function draw();
   }

Andi

At 03:26 PM 10/9/2004 +0200, Timm Friebe wrote:
>Hi,
>the attached script produces:
>
>Fatal error: Can't inherit abstract function Drawable::draw()
>(previously declared abstract in Figure) in /usr/home/thekid/r.php on
>line 12
>
>which is wrong because I am not inheriting anything but implementing an
>interface.
>
>The problem is that both zend_do_inheritance() *and*
>zend_do_implement_interface() use (merge_checker_func_t)
>do_inherit_method_check.
>
>Want me to open a bug report?
>
>- Timm
