# Constants and static methods for internal classes

- Thread: https://externals.io/message/18551
- Original archive: https://news-web.php.net/php.internals/18551
- Started by Dmitry Stogov on 2005-08-30T07:59:36+00:00
- Messages: 4
- 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

---

## #18551 — Dmitry Stogov — 2005-08-30T07:59:36+00:00

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

Hi,

You can look into proposal patch that implements support for constants and
static methods for internal classes. The original patch was written by
Michael and improved by me.

The patch is maden for "easiest" usage and it doesn't support internal
array/constants properties (they weren't supported before).
Unless something thinks array/constants are badly needed (we think they
probably aren't) we prefer to keep it simple like this.

Support for array and constant properties will require additional
complicated API.

Thanks. Dmitry.

---

## #18552 — Michael Wallner — 2005-08-30T08:23:39+00:00

URL: https://externals.io/message/18551#18552 · In reply to: #18551

Hi Dmitry Stogov, you wrote:

> You can look into proposal patch that implements support for constants and 
> static methods for internal classes. The original patch was written by 
> Michael and improved by me.

Is it my (mailers) fault or didn't the patch make it through?

Thanks,
-- 
Michael - < mike(@)php.net

---

## #18554 — Michael Wallner — 2005-08-30T09:55:42+00:00

URL: https://externals.io/message/18551#18554 · In reply to: #18551

Hi Dmitry Stogov, you wrote:

> The patch is maden for "easiest" usage and it doesn't support internal
> array/constants properties (they weren't supported before).

So why burden the weigh of allocation, initialization, destruction
and freeing on the extension developer?  This will force every extension
writer to implement a kind of my dup_zval() function, wouldn't it?
And as there's not much reference devs will spam the list on how
to use static properties right.  I think we could avoid this by
stretching the minimalistic approach a bit and provide at least
a zend_init_static_properties().

Thanks a lot,
-- 
Michael - < mike(@)php.net

---

## #18556 — Michael Wallner — 2005-08-30T10:54:55+00:00

URL: https://externals.io/message/18551#18556 · In reply to: #18554

I wrote:

> So why burden the weigh of allocation, initialization, destruction
> and freeing on the extension developer?  This will force every extension
> writer to implement a kind of my dup_zval() function, wouldn't it?
> And as there's not much reference devs will spam the list on how
> to use static properties right.  I think we could avoid this by
> stretching the minimalistic approach a bit and provide at least
> a zend_init_static_properties().

One note more though :-/
If we leave out the zend_update_static_property() API,
extension developers need to reinvent the wheel again
and again.

Regards,
-- 
Michael - < mike(@)php.net
