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.
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