From: Jani Taskinen Date: Tue, 6 Nov 2007 13:28:21 +0000 (+0000) Subject: MFH: - Fixed bug #43196 (array_intersect_assoc() crashes with non-array input) X-Git-Tag: php-5.2.5~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=df35a307ccdd7783c83a19e377e31798f490db66;p=php MFH: - Fixed bug #43196 (array_intersect_assoc() crashes with non-array input) --- diff --git a/NEWS b/NEWS index f352b0e63d..09212c0648 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? Nov 2007 , PHP 5.2.5 +- Fixed bug #43196 (array_intersect_assoc() crashes with non-array input). + (Jani) 01 Nov 2007, PHP 5.2.5RC2 - Added ability to control memory consumption between request using diff --git a/ext/standard/array.c b/ext/standard/array.c index d27894c6dd..478a441acf 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -2979,13 +2979,24 @@ static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compa intersect_data_compare_func = zval_compare; } + if (Z_TYPE_PP(args[0]) != IS_ARRAY) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #1 is not an array"); + RETVAL_NULL(); + goto out; + } + array_init(return_value); for (p = Z_ARRVAL_PP(args[0])->pListHead; p != NULL; p = p->pListNext) { if (p->nKeyLength == 0) { ok = 1; for (i = 1; i < argc; i++) { - if (zend_hash_index_find(Z_ARRVAL_PP(args[i]), p->h, (void**)&data) == FAILURE || + if (Z_TYPE_PP(args[i]) != IS_ARRAY) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is not an array", i + 1); + zval_dtor(return_value); + RETVAL_NULL(); + goto out; + } else if (zend_hash_index_find(Z_ARRVAL_PP(args[i]), p->h, (void**)&data) == FAILURE || (intersect_data_compare_func && intersect_data_compare_func((zval**)p->pData, data TSRMLS_CC) != 0)) { ok = 0; @@ -2999,7 +3010,12 @@ static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compa } else { ok = 1; for (i = 1; i < argc; i++) { - if (zend_hash_quick_find(Z_ARRVAL_PP(args[i]), p->arKey, p->nKeyLength, p->h, (void**)&data) == FAILURE || + if (Z_TYPE_PP(args[i]) != IS_ARRAY) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is not an array", i + 1); + zval_dtor(return_value); + RETVAL_NULL(); + goto out; + } else if (zend_hash_quick_find(Z_ARRVAL_PP(args[i]), p->arKey, p->nKeyLength, p->h, (void**)&data) == FAILURE || (intersect_data_compare_func && intersect_data_compare_func((zval**)p->pData, data TSRMLS_CC) != 0)) { ok = 0; @@ -3012,6 +3028,7 @@ static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compa } } } +out: efree(args); } /* }}} */ @@ -3440,13 +3457,24 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty diff_data_compare_func = zval_compare; } + if (Z_TYPE_PP(args[0]) != IS_ARRAY) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #1 is not an array"); + RETVAL_NULL(); + goto out; + } + array_init(return_value); for (p = Z_ARRVAL_PP(args[0])->pListHead; p != NULL; p = p->pListNext) { if (p->nKeyLength == 0) { ok = 1; for (i = 1; i < argc; i++) { - if (zend_hash_index_find(Z_ARRVAL_PP(args[i]), p->h, (void**)&data) == SUCCESS && + if (Z_TYPE_PP(args[i]) != IS_ARRAY) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is not an array", i + 1); + zval_dtor(return_value); + RETVAL_NULL(); + goto out; + } else if (zend_hash_index_find(Z_ARRVAL_PP(args[i]), p->h, (void**)&data) == SUCCESS && (!diff_data_compare_func || diff_data_compare_func((zval**)p->pData, data TSRMLS_CC) == 0)) { ok = 0; @@ -3460,7 +3488,12 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty } else { ok = 1; for (i = 1; i < argc; i++) { - if (zend_hash_quick_find(Z_ARRVAL_PP(args[i]), p->arKey, p->nKeyLength, p->h, (void**)&data) == SUCCESS && + if (Z_TYPE_PP(args[i]) != IS_ARRAY) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is not an array", i + 1); + zval_dtor(return_value); + RETVAL_NULL(); + goto out; + } else if (zend_hash_quick_find(Z_ARRVAL_PP(args[i]), p->arKey, p->nKeyLength, p->h, (void**)&data) == SUCCESS && (!diff_data_compare_func || diff_data_compare_func((zval**)p->pData, data TSRMLS_CC) == 0)) { ok = 0; @@ -3473,6 +3506,7 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty } } } +out: efree(args); } /* }}} */ diff --git a/ext/standard/tests/array/array_intersect_assoc_variation1.phpt b/ext/standard/tests/array/array_intersect_assoc_variation1.phpt index 3df11c6b85..713ed82f97 100644 --- a/ext/standard/tests/array/array_intersect_assoc_variation1.phpt +++ b/ext/standard/tests/array/array_intersect_assoc_variation1.phpt @@ -109,174 +109,173 @@ fclose($fp); echo "Done"; ?> --EXPECTF-- -*** Testing array_intersect() : Passing non-array values to $arr1 argument *** +*** Testing array_intersect_assoc() : Passing non-array values to $arr1 argument *** --- Iterator 1 -- -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +-- Iteration 1 -- +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL --- Iterator 2 -- -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +-- Iteration 2 -- +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL --- Iterator 3 -- -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +-- Iteration 3 -- +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL --- Iterator 4 -- -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +-- Iteration 4 -- +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL --- Iterator 5 -- -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +-- Iteration 5 -- +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL --- Iterator 6 -- -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +-- Iteration 6 -- +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL --- Iterator 7 -- -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +-- Iteration 7 -- +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL --- Iterator 8 -- -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +-- Iteration 8 -- +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL --- Iterator 9 -- -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +-- Iteration 9 -- +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL --- Iterator 10 -- -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +-- Iteration 10 -- +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL --- Iterator 11 -- -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +-- Iteration 11 -- +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL --- Iterator 12 -- -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +-- Iteration 12 -- +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL --- Iterator 13 -- -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +-- Iteration 13 -- +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL --- Iterator 14 -- -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +-- Iteration 14 -- +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL --- Iterator 15 -- -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +-- Iteration 15 -- +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL --- Iterator 16 -- -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +-- Iteration 16 -- +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL --- Iterator 17 -- -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +-- Iteration 17 -- +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL --- Iterator 18 -- -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +-- Iteration 18 -- +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL --- Iterator 19 -- -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +-- Iteration 19 -- +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL --- Iterator 20 -- -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +-- Iteration 20 -- +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL --- Iterator 21 -- -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +-- Iteration 21 -- +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL --- Iterator 22 -- -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +-- Iteration 22 -- +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL --- Iterator 23 -- -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +-- Iteration 23 -- +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL --- Iterator 24 -- -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +-- Iteration 24 -- +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #1 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #1 is not an array in %s on line %d NULL Done - diff --git a/ext/standard/tests/array/array_intersect_assoc_variation2.phpt b/ext/standard/tests/array/array_intersect_assoc_variation2.phpt index 4026f8caf2..e82e7cfecd 100644 --- a/ext/standard/tests/array/array_intersect_assoc_variation2.phpt +++ b/ext/standard/tests/array/array_intersect_assoc_variation2.phpt @@ -110,174 +110,173 @@ fclose($fp); echo "Done"; ?> --EXPECTF-- -*** Testing array_intersect() : Passing non-array values to $arr2 argument *** +*** Testing array_intersect_assoc() : Passing non-array values to $arr2 argument *** --- Iterator 1 -- -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +-- Iteration 1 -- +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL --- Iterator 2 -- -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +-- Iteration 2 -- +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL --- Iterator 3 -- -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +-- Iteration 3 -- +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL --- Iterator 4 -- -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +-- Iteration 4 -- +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL --- Iterator 5 -- -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +-- Iteration 5 -- +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL --- Iterator 6 -- -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +-- Iteration 6 -- +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL --- Iterator 7 -- -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +-- Iteration 7 -- +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL --- Iterator 8 -- -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +-- Iteration 8 -- +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL --- Iterator 9 -- -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +-- Iteration 9 -- +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL --- Iterator 10 -- -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +-- Iteration 10 -- +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL --- Iterator 11 -- -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +-- Iteration 11 -- +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL --- Iterator 12 -- -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +-- Iteration 12 -- +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL --- Iterator 13 -- -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +-- Iteration 13 -- +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL --- Iterator 14 -- -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +-- Iteration 14 -- +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL --- Iterator 15 -- -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +-- Iteration 15 -- +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL --- Iterator 16 -- -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +-- Iteration 16 -- +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL --- Iterator 17 -- -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +-- Iteration 17 -- +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL --- Iterator 18 -- -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +-- Iteration 18 -- +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL --- Iterator 19 -- -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +-- Iteration 19 -- +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL --- Iterator 20 -- -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +-- Iteration 20 -- +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL --- Iterator 21 -- -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +-- Iteration 21 -- +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL --- Iterator 22 -- -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +-- Iteration 22 -- +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL --- Iterator 23 -- -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +-- Iteration 23 -- +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL --- Iterator 24 -- -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +-- Iteration 24 -- +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL -Warning: array_intersect(): Argument #2 is not an array in %s on line %d +Warning: array_intersect_assoc(): Argument #2 is not an array in %s on line %d NULL Done -