From: Hannes Magnusson Date: Tue, 3 Oct 2006 16:36:57 +0000 (+0000) Subject: compact() doesnt throw "wrong param count" X-Git-Tag: RELEASE_1_0_0RC1~1455 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0eaea000db2dc5c7275bf8d7b82c8ebd385359ee;p=php compact() doesnt throw "wrong param count" --- diff --git a/ext/standard/array.c b/ext/standard/array.c index ac284f45f1..b5e1617945 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -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) {