]> granicus.if.org Git - php/commitdiff
MFH: compact() doesnt throw "wrong param count"
authorHannes Magnusson <bjori@php.net>
Tue, 3 Oct 2006 16:37:51 +0000 (16:37 +0000)
committerHannes Magnusson <bjori@php.net>
Tue, 3 Oct 2006 16:37:51 +0000 (16:37 +0000)
ext/standard/array.c

index 9d986137d1cc1e8e8dba03eafd9707ef2fb20a11..13a6ff2c9c3ae726a29eb21f98a38cac69d55862 100644 (file)
@@ -1507,6 +1507,9 @@ PHP_FUNCTION(compact)
        zval ***args;                   /* function arguments array */
        int i;
        
+       if (ZEND_NUM_ARGS() < 1) {
+               WRONG_PARAM_COUNT;
+       }
        args = (zval ***)safe_emalloc(ZEND_NUM_ARGS(), sizeof(zval **), 0);
        
        if (zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE) {