# Supprting static getter/setter

- Thread: https://externals.io/message/56462
- Original archive: https://news-web.php.net/php.internals/56462
- Started by Clint M Priest on 2011-11-21T19:07:32+00:00
- Messages: 1
- 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

---

## #56462 — Clint M Priest — 2011-11-21T19:07:32+00:00

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

I've implemented a good majority of the getter/setter syntax for objects which was pretty easy due to the already implemented functionality of __get()/__set().

For static getters/setters there is no such obvious place to hook the new functionality, I was considering modifying the ZEND_ASSIGN opcode which would look back to the previous opcode (which should be a ZEND_FETCH_W) to identify the class/variable and then call the setter when appropriate.

Does that seem like a good strategy or would you recommend some other way?

-Clint
