From 0eaea000db2dc5c7275bf8d7b82c8ebd385359ee Mon Sep 17 00:00:00 2001 From: Hannes Magnusson Date: Tue, 3 Oct 2006 16:36:57 +0000 Subject: [PATCH] compact() doesnt throw "wrong param count" --- ext/standard/array.c | 3 +++ 1 file changed, 3 insertions(+) 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) { -- 2.40.0