rfc:invokable
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
rfc:invokable [2008/08/02 16:11] – created colder | rfc:invokable [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 13: | Line 13: | ||
Currently, there is no sane way to detect whether an object can be invoked or not. What this RFC proposes is an interface that covers %%__invoke()%%: | Currently, there is no sane way to detect whether an object can be invoked or not. What this RFC proposes is an interface that covers %%__invoke()%%: | ||
+ | <code php> | ||
interface Invokable { | interface Invokable { | ||
| | ||
Line 25: | Line 25: | ||
/* ... */ | /* ... */ | ||
} | } | ||
+ | </ | ||
And make $obj(); possible only if the interface is implemented, | And make $obj(); possible only if the interface is implemented, | ||
We have other examples of magic features that are covered by interfaces, like ArrayAccess or Iterator/ | We have other examples of magic features that are covered by interfaces, like ArrayAccess or Iterator/ | ||
rfc/invokable.1217693463.txt.gz · Last modified: 2017/09/22 13:28 (external edit)