# making PHP_FUNCTION static?

- Thread: https://externals.io/message/24936
- Original archive: https://news-web.php.net/php.internals/24936
- Started by Nuno Lopes on 2006-07-24T16:48:29+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

---

## #24936 — Nuno Lopes — 2006-07-24T16:48:29+00:00

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

Hello,

I was wondering if we could make ZEND_FUNCTION() declaration static. This 
represents a compatibility break with previous PHP versions, but only 
extensions that already declare the function as static would be affected. 
Declaring a function as static (or anything else) decreases load times and 
the size of the dso, allows better optimizations by the compiler, etc.. So 
its all advantages :) (well, then all functions must be defined or 
#include'd in the same file as the function table).

There are some (few) extensions that already mark their functions as static, 
so should we use a wide static keywording, by changing the macro, or add the 
keyword locally?


Nuno

P.S.: Anyone that wants to learn more about why, how and when to use static 
and const keywords, just read the Ulrich Drepper dso paper.

---

## #24937 — Marcus Boerger — 2006-07-24T17:12:03+00:00

URL: https://externals.io/message/24936#24937 · In reply to: #24936

Hello Nuno,

  i think this is a good idea and i suggest that we drop the static from
those extensions. The question is whether we need new macros for non static
cases and hope we don't.

best regards
marcus

Monday, July 24, 2006, 9:48:29 AM, you wrote:

> Hello,

> I was wondering if we could make ZEND_FUNCTION() declaration static. This 
> represents a compatibility break with previous PHP versions, but only 
> extensions that already declare the function as static would be affected. 
> Declaring a function as static (or anything else) decreases load times and 
> the size of the dso, allows better optimizations by the compiler, etc.. So 
> its all advantages :) (well, then all functions must be defined or 
> #include'd in the same file as the function table).

> There are some (few) extensions that already mark their functions as static,
> so should we use a wide static keywording, by changing the macro, or add the
> keyword locally?


> Nuno

> P.S.: Anyone that wants to learn more about why, how and when to use static 
> and const keywords, just read the Ulrich Drepper dso paper. 




Best regards,
 Marcus
