# add fn_flags to getMethod() result (reflection)

- Thread: https://externals.io/message/7990
- Original archive: https://news-web.php.net/php.internals/7990
- Started by Pierre-Alain Joye on 2004-02-19T14:51:41+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

---

## #7990 — Pierre-Alain Joye — 2004-02-19T14:51:41+00:00

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

Hello,

Regarding the question about how to know if a method is declared static
or not, I add the fn_flags to the result (flags property) of
getMethod();. I tested it with PHP userland classes but not internal
objects. This new property reflects the internal fn_flags in
zend_function struct. The constants required are already available so
it's easy to get the method type.

If I missed some other reflection methods which already provide this
info, please point me to them :)

hth

pierre

---

## #8003 — Marcus Boerger — 2004-02-19T15:32:49+00:00

URL: https://externals.io/message/7990#8003 · In reply to: #7990

Hello Pierre-Alain,

Thursday, February 19, 2004, 3:51:41 PM, you wrote:

> Hello,

> Regarding the question about how to know if a method is declared static
> or not, I add the fn_flags to the result (flags property) of
> getMethod();. I tested it with PHP userland classes but not internal
> objects. This new property reflects the internal fn_flags in
> zend_function struct. The constants required are already available so
> it's easy to get the method type.

> If I missed some other reflection methods which already provide this
> info, please point me to them :)

here you go:
php -r '$m = new reflection_method("reflection_method","export"); var_dump($m->isStatic());'


-- 
Best regards,
 Marcus                            mailto:helly@php.net
