cvs: ZendEngine2(PHP_5_3) / zend_builtin_functions.c /tests 017.phpt

"Felipe Pena" <[email protected]> Thu, 07 May 2009 12:08:09 -0000
Newsgroups gmane.comp.php.cvs.zend
Message-ID <cvsfelipe1241698089@cvsserver>
felipe		Thu May  7 12:08:09 2009 UTC

  Modified files:              (Branch: PHP_5_3)
    /ZendEngine2	zend_builtin_functions.c 
    /ZendEngine2/tests	017.phpt 
  Log:
  - MFH: Parameter parsing changes for get_defined_constants() (Kalle)
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_builtin_functions.c?r1=1.277.2.12.2.25.2.47&r2=1.277.2.12.2.25.2.48&diff_format=u
Index: ZendEngine2/zend_builtin_functions.c
diff -u ZendEngine2/zend_builtin_functions.c:1.277.2.12.2.25.2.47 ZendEngine2/zend_builtin_functions.c:1.277.2.12.2.25.2.48
--- ZendEngine2/zend_builtin_functions.c:1.277.2.12.2.25.2.47	Mon Mar 16 09:51:31 2009
+++ ZendEngine2/zend_builtin_functions.c	Thu May  7 12:08:09 2009
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_builtin_functions.c,v 1.277.2.12.2.25.2.47 2009/03/16 09:51:31 dmitry Exp $ */
+/* $Id: zend_builtin_functions.c,v 1.277.2.12.2.25.2.48 2009/05/07 12:08:09 felipe Exp $ */
 
 #include "zend.h"
 #include "zend_API.h"
@@ -1805,19 +1805,19 @@
 /* }}} */
 
 
-/* {{{ proto array get_defined_constants([mixed categorize])
+/* {{{ proto array get_defined_constants([bool categorize])
    Return an array containing the names and values of all defined constants */
 ZEND_FUNCTION(get_defined_constants)
 {
-	int argc = ZEND_NUM_ARGS();
-
-	if (argc != 0 && argc != 1) {
-		ZEND_WRONG_PARAM_COUNT();
+	zend_bool categorize = 0;
+	
+	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &categorize) == FAILURE) {
+		return;
 	}
 
 	array_init(return_value);
 
-	if (argc) {
+	if (categorize) {
 		HashPosition pos;
 		zend_constant *val;
 		int module_number;
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/017.phpt?r1=1.1.2.6.2.2&r2=1.1.2.6.2.3&diff_format=u
Index: ZendEngine2/tests/017.phpt
diff -u ZendEngine2/tests/017.phpt:1.1.2.6.2.2 ZendEngine2/tests/017.phpt:1.1.2.6.2.3
--- ZendEngine2/tests/017.phpt:1.1.2.6.2.2	Wed Jun 18 23:38:37 2008
+++ ZendEngine2/tests/017.phpt	Thu May  7 12:08:09 2009
@@ -60,7 +60,7 @@
 Warning: get_loaded_extensions() expects at most 1 parameter, 2 given in %s on line %d
 NULL
 
-Warning: Wrong parameter count for get_defined_constants() in %s on line %d
+Warning: get_defined_constants() expects at most 1 parameter, 2 given in %s on line %d
 NULL
 string(5) "array"
 string(5) "array"



-- 
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php