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

index ac284f45f18776fe75e7bdf3d9eb337daeeb75bf..b5e1617945856e847fccb7f24b48ef6e0f1d4eaf 100644 (file)
@@ -1567,6 +1567,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) {