Re: cvs: php4 / CODING_STANDARDS
| From: | Yasuo Ohgaki | Date: | Sun, 08 Sep 2002 23:55:40 +0000 |
| Subject: | Re: cvs: php4 / CODING_STANDARDS | ||
| References: | 1 2 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-13953@lists.php.net to get a copy of this message | ||
derick@php.net wrote:
On Sun, 8 Sep 2002, Yasuo Ohgaki wrote:PHP_* macros are mostly used, but ZEND_* macros are preffered, IMHO. I asked about PHP_* & ZEND_* macro issue long time ago when Zend became BSD style license. As a result of discussion, I added following entry. [7] Use ZEND_* macros instead of PHP_* macros. Use of PHP_* macros is notyohgaki Sun Sep 8 18:38:57 2002 EDTerm, where was this decided? The whole source uses PHP_FUNCTION... [derick@kossu php-4.3.0dev]$ grep -r PHP_FUNCTION * | wc -l 5990 [derick@kossu php-4.3.0dev]$ grep -r ZEND_FUNCTION * | wc -lModified files: /php4 CODING_STANDARDS Log:It seems we're better to mention about missing functions. PHP_FUNCTION -> ZEND_FUNCTION217So I'd rather see those other functions converted to PHP_FUNCTION (execpt the zend builtin stuff of course). Derick
recommended. Since most of the PHP_* macros are ZEND_* macro aliases, using
the PHP_* macros makes browsing the source code with a tag search harder.
Since Zend is BSD license now, I suppose we are better to
start using ZEND_* macros for better readablity and better consistency
for future PHP versions.
--
Yasuo Ohgaki
Index: php4/CODING_STANDARDS diff -u php4/CODING_STANDARDS:1.18 php4/CODING_STANDARDS:1.19 --- php4/CODING_STANDARDS:1.18 Thu Aug 22 10:04:01 2002 +++ php4/CODING_STANDARDS Sun Sep 8 18:38:57 2002 @@ -115,11 +115,15 @@--------------------------------------------------------------------------- Did I help you? http://www.derickrethans.nl/link.php?url=giftlist Frequent ranting: http://www.derickrethans.nl/ ---------------------------------------------------------------------------cvs user foo. This allows easier tracking of why code was commented out, especially in bundled libraries. +[10] Do no define that is not available. For instance, if library available is + missing function(s), do not define function nor raise error for missing + function(s).+ Naming Conventions ------------------ [1] Function names for user-level functions should be enclosed with in- the PHP_FUNCTION() macro. They should be in lowercase, with words + the ZEND_FUNCTION() macro. They should be in lowercase, with words underscore delimited, with care taken to minimize the letter count. Abbreviations should not be used when they greatly decrease the readability of the function name itself.@@ -220,7 +224,7 @@ /* {{{ proto int abs(int number) Returns the absolute value of the number */ -PHP_FUNCTION(abs) +ZEND_FUNCTION(abs) { ... } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpPHP: Scripting the Web - derick@php.net All your branches are belong to me! SRM: Script Running Machine - www.vl-srm.net---------------------------------------------------------------------------