]> granicus.if.org Git - php/commitdiff
- Fixed bug #45605 (array_uintersect_assoc gives incorrect error message)
authorFelipe Pena <felipe@php.net>
Wed, 23 Jul 2008 16:27:16 +0000 (16:27 +0000)
committerFelipe Pena <felipe@php.net>
Wed, 23 Jul 2008 16:27:16 +0000 (16:27 +0000)
  (patch by ilewis at uk dot ibm dot com)

ext/standard/array.c

index 6737445dd5e9488810eb77037ceaab04f514b450..ede9416df6fb522b6d5d4bf6e922c73eab6c0d05 100644 (file)
@@ -3061,10 +3061,14 @@ static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compa
        /* Get the argument count */
        argc = ZEND_NUM_ARGS();
        if (data_compare_type == INTERSECT_COMP_DATA_USER) {
-               if (argc < 3 || zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+f", &args, &argc, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) {
+               if (argc < 3) {
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "at least 3 parameters are required, %d given", ZEND_NUM_ARGS());
                        return;
                }
+               
+               if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+f", &args, &argc, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) {
+                       return;
+               }
                intersect_data_compare_func = zval_user_compare;
        } else {
                if (argc < 2 || zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) {