Stanislav Malyshev escribió:
Hi!

While we nearing the release of 5.3 (hopefully?), there are many functions in the PHP code which still use old parameter parsing API (zend_get_parameters_ex) instead of the new one (zend_parse_parameters).

P.S. if some genius would invent a script to automate that - it'd be awesome, but I don't have very high hopes on that. :)

The attached patch may also help both core and PECL extensions, emiting a deprecation compile warning when those functions are used.

ps: you have to add the attribute to all deprecated functions ;-)


--

Cristian Rodríguez R.
Platform/OpenSUSE - Core Services
SUSE LINUX Products GmbH
Research & Development
http://www.opensuse.org/

Index: Zend/zend.h
===================================================================
RCS file: /repository/ZendEngine2/zend.h,v
retrieving revision 1.293.2.11.2.9.2.21
diff -u -p -r1.293.2.11.2.9.2.21 zend.h
--- Zend/zend.h	11 Jun 2008 13:18:39 -0000	1.293.2.11.2.9.2.21
+++ Zend/zend.h	26 Jun 2008 00:03:52 -0000
@@ -176,6 +176,12 @@ char *alloca ();
 # define ZEND_ATTRIBUTE_PTR_FORMAT(type, idx, first)
 #endif
 
+#if ZEND_GCC_VERSION >= 3001
+# define ZEND_ATTRIBUTE_DEPRECATED  __attribute__((deprecated))
+#else
+# define ZEND_ATTRIBUTE_DEPRECATED
+#endif
+
 #if defined(__GNUC__) && ZEND_GCC_VERSION >= 3400 && defined(__i386__)
 # define ZEND_FASTCALL __attribute__((fastcall))
 #elif defined(_MSC_VER) && defined(_M_IX86)
Index: Zend/zend_API.h
===================================================================
RCS file: /repository/ZendEngine2/zend_API.h,v
retrieving revision 1.207.2.8.2.8.2.12
diff -u -p -r1.207.2.8.2.8.2.12 zend_API.h
--- Zend/zend_API.h	27 May 2008 10:29:33 -0000	1.207.2.8.2.8.2.12
+++ Zend/zend_API.h	26 Jun 2008 00:03:52 -0000
@@ -199,7 +199,7 @@ int zend_next_free_module(void);
 BEGIN_EXTERN_C()
 ZEND_API int zend_get_parameters(int ht, int param_count, ...);
 ZEND_API int _zend_get_parameters_array(int ht, int param_count, zval **argument_array TSRMLS_DC);
-ZEND_API int zend_get_parameters_ex(int param_count, ...);
+ZEND_API int zend_get_parameters_ex(int param_count, ...) ZEND_ATTRIBUTE_DEPRECATED;
 ZEND_API int _zend_get_parameters_array_ex(int param_count, zval ***argument_array TSRMLS_DC);
 
 /* internal function to efficiently copy parameters when executing __call() */

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to