summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/tests/017.phpt2
-rw-r--r--Zend/zend_builtin_functions.c12
2 files changed, 7 insertions, 7 deletions
diff --git a/Zend/tests/017.phpt b/Zend/tests/017.phpt
index 09ad123c7e..03c1e73175 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 6f1774de27..4c430274c4 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -1805,19 +1805,19 @@ ZEND_FUNCTION(get_loaded_extensions)
/* }}} */
-/* {{{ 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;