Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24319 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11212 invoked by uid 1010); 11 Jul 2006 03:23:03 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 11197 invoked from network); 11 Jul 2006 03:23:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Jul 2006 03:23:03 -0000 X-PHP-List-Original-Sender: php_lists@realplain.com X-Host-Fingerprint: 209.142.136.132 msa2-mx.centurytel.net Linux 2.4/2.6 Received: from ([209.142.136.132:42338] helo=msa2-mx.centurytel.net) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id 8A/6D-16663-59913B44 for ; Mon, 10 Jul 2006 23:23:03 -0400 Received: from pc1 (72-161-143-169.dyn.centurytel.net [72.161.143.169]) by msa2-mx.centurytel.net (8.13.6/8.13.6) with SMTP id k6B3Mvug001593 for ; Mon, 10 Jul 2006 22:22:58 -0500 Message-ID: <008501c6a499$4f2c6960$0201a8c0@pc1> To: Date: Mon, 10 Jul 2006 22:22:58 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Subject: PHPAPI, globals, and number_format From: php_lists@realplain.com ("Matt W") 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, '.', ',', ) 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