Hi all,

First I'll ask 2 general questions...  Not sure if I have the terminology
right, but functions that are declared as PHPAPI (meaning, available to
shared extensions??) -- or any functions, I guess, but I'm thinking ones
used by third-party extensions, etc. -- when can their definition be
changed, by adding parameters or such?  Since those extensions would need to
update their code...  Are changes like that allowed going from 5.1 to 5.2?
Or 6?

And am I correct to assume that, in a function used by some shared
extension, any globals will work fine when it's called from that extension?
(As long as TSRMLS stuff is passed/available, of course.)  e.g. If the
globals are FOR the function and defined "at the same time," they're
available if the function is?

One of the changes I wanted to make to number_format is an option to not
have trailing zeros/point in the decimal part:

number_format(123, 2, '.', ',', <new bool param>)

would return 123, like "(string) round(123, 2)" or %g format specifier,
instead of 123.00, but never scientific notation (like %g does depending on
exponent).  I'm sure I'm not the only one that has wanted grouped thousands
and/or custom decimal point *without* the result being zero-padded to the
specified number of places. :-)

Anyway, I think it's best to handle this in _php_math_number_format instead
of PHP_FUNCTION(number_format), but the function probably needs another
parameter for that, hence why I'm wondering if it can be changed in 5.2/6.
(Actually, I guess I could make the decimal places be negative to specify
the option.)

Finally, asking about globals because I was wondering if
zero-padding/-removal should be an INI option/global, if the new
number_format param isn't specified?  But, if so, that would probably be
better checked in PHP_FUNCTION(number_format)...

I'm just trying to help make PHP better, though only in a small way, so I
hope to get some feedback, even if you think it's stupid feature change. ;-)

Thanks!

Matt

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to