# PHP5 extensions: using existing functionnames as method names

- Thread: https://externals.io/message/25652
- Original archive: https://news-web.php.net/php.internals/25652
- Started by danhen@email.de on 2006-09-13T08:09:08+00:00
- Messages: 2
- 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

---

## #25652 — danhen@email.de — 2006-09-13T08:09:08+00:00

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

Hi,

i just was wondering how existing function names could be used as method names
in OO-Extensions for PHP5. I've looked through the SPL-source where this is done with
functions like `current()` and `next()` in the iterators, but I couldn't find a hint how to do this.

Can someone give me a little hint what is needed to do that.

Many thanks in advance,
Daniel

---

## #25653 — messju mohr — 2006-09-13T08:45:17+00:00

URL: https://externals.io/message/25652#25653 · In reply to: #25652

> Hi,
> 
> i just was wondering how existing function names could be used as method names
> in OO-Extensions for PHP5. I've looked through the SPL-source where this is done with
> functions like `current()` and `next()` in the iterators, but I couldn't find a hint how to do this.
> 
> Can someone give me a little hint what is needed to do that.

you can use any function name as method name without a clash. you just
cannot use language constructs that aren't real functions like
"empty", "echo" or "require" as method names.

this question better belongs to php-general, btw.

> Many thanks in advance,
> Daniel
