Re: Interface and abstract method
| From: | Peter Cowburn | Date: | Wed, 19 May 2010 12:53:02 +0000 |
| Subject: | Re: Interface and abstract method | ||
| References: | 1 2 3 4 | Groups: | php.doc php.internals |
| Request: | Send a blank email to phpdoc+get-969381834@lists.php.net to get a copy of this message | ||
On 19 May 2010 13:31, Richard Quadling <rquadling@googlemail.com> wrote:
> On 19 May 2010 13:27, mathieu.suen <mathieu.suen@easyflirt.com> wrote:
>> Ok so there is no real meaning behind the "abstract".
>> Thanks
>>
>> On 05/18/2010 05:55 PM, Tjerk Anne Meesters wrote:
>>>
>>> Normally, PHP won't allow access types for interface methods, but the
>>> reflection for SPL is defined inside the C code:
>>>
>>> static const zend_function_entry spl_funcs_OuterIterator[] = {
>>> SPL_ABSTRACT_ME(OuterIterator, getInnerIterator,
>>> arginfo_recursive_it_void)
>>> {NULL, NULL, NULL}
>>> };
>>>
>>> IMO the SPL_ME should be used instead, but I wouldn't be bothered about it
>>> ;-)
For what it's worth, the non-SPL interfaces use ZEND_ABSTRACT_ME or
similar as far as I can tell. Also, reflection says that all of the
interface methods are abstract (which they are, in the sense of not
having any method body).
>>>
>>> On Tue, May 18, 2010 at 11:12 PM, mathieu.suen
>>> <mathieu.suen@easyflirt.com> wrote:
>>>
>>>>
>>>> Hi,
>>>>
>>>> In the SPL there is some interface that have abstract method:
>>>>
>>>> *Countable* {
>>>> /* Methods */
>>>> abstract public int
>>>>
>>>> count<http://www.php.net/manual/en/countable.count.php>
>>>> ( void )
>>>> }
>>>>
>>>> While some interface have "none abstract" method.
>>>>
>>>> *OuterIterator* extends Iterator
>>>>
>>>> <http://www.php.net/manual/en/class.iterator.php> {
>>>> /* Methods */
>>>> public Iterator getInnerIterator
>>>>
>>>> <http://www.php.net/manual/en/outeriterator.getchildren.php>
>>>> ( void )
>>>> ..snip..
>>>> }
>>>>
>>>> Does "abstract" keyword have a semantic?
>>>>
>>>> Thanks
>>>>
>>>> --Mathieu suen
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>> -- Mathieu Suen
>>
>>
>>
>>
>
> Seemingly not when it applies to an interface.
>
I think the key issue is that _in the docs_ some interface methods are
marked up as abstract, yet others aren't. I suggest making them
consistent, having them all being one or t'other.
> --
> -----
> Richard Quadling
> "Standing on the shoulders of some very clever giants!"
> EE : http://www.experts-exchange.com/M_248814.html
> EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
> Zend Certified Engineer : ®׆÷
> Wõ§ÅIÜ
> ZOPA : http://uk.zopa.com/member/RQuadling
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>