]> granicus.if.org Git - php/commitdiff
- Fixed bug #48629 (get_defined_constants() ignores categorize parameter)
authorFelipe Pena <felipe@php.net>
Mon, 22 Jun 2009 00:03:24 +0000 (00:03 +0000)
committerFelipe Pena <felipe@php.net>
Mon, 22 Jun 2009 00:03:24 +0000 (00:03 +0000)
NEWS
Zend/tests/017.phpt
Zend/zend_builtin_functions.c

diff --git a/NEWS b/NEWS
index 9d26462c1c8db4c7ed43ebbfda7c260c9ddf7dc4..822b46c70162067765044d17a7f2259aaff7edae 100644 (file)
--- 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)
 
index 9ed7732765b9e7fc21ddf74ab47b726f952040c8..f5042356663ed0ac2c9b711227027aa8c6611ae6 100644 (file)
@@ -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"
index 584b13a074f02b3ef3ebe3fc4552e6a187a3975b..185fb361c486b8a8bc4259d4e9cbfe19aa3129b5 100644 (file)
@@ -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;