From: Felipe Pena Date: Mon, 22 Jun 2009 00:03:24 +0000 (+0000) Subject: - Fixed bug #48629 (get_defined_constants() ignores categorize parameter) X-Git-Tag: php-5.2.11RC1~253 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=01c9097c74c0870ef23d8a0d34b105984f8ba292;p=php - Fixed bug #48629 (get_defined_constants() ignores categorize parameter) --- diff --git a/NEWS b/NEWS index 9d26462c1c..822b46c701 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2009, PHP 5.2.11 +- Fixed bug #48629 (get_defined_constants() ignores categorize parameter). + (Felipe) - Fixed bug #48276 (date("Y") on big endian machines produces the wrong result). (Scott) diff --git a/Zend/tests/017.phpt b/Zend/tests/017.phpt index 9ed7732765..f504235666 100644 --- a/Zend/tests/017.phpt +++ b/Zend/tests/017.phpt @@ -60,7 +60,7 @@ int(%d) 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" diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 584b13a074..185fb361c4 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -1618,15 +1618,15 @@ ZEND_FUNCTION(get_loaded_extensions) Return an array containing the names and values of all defined constants */ ZEND_FUNCTION(get_defined_constants) { - int argc = ZEND_NUM_ARGS(); + zend_bool categorize = 0; - if (argc != 0 && argc != 1) { - ZEND_WRONG_PARAM_COUNT(); + 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;