]> granicus.if.org Git - php/commitdiff
@- Let array_search() accept objects as a needle under ZendEngine2. (Moriyoshi)
authorMoriyoshi Koizumi <moriyoshi@php.net>
Mon, 9 Dec 2002 15:54:38 +0000 (15:54 +0000)
committerMoriyoshi Koizumi <moriyoshi@php.net>
Mon, 9 Dec 2002 15:54:38 +0000 (15:54 +0000)
ext/standard/array.c

index c40ba3405f6f34c1ac048a6135dab0b951345cb8..c3c6c74063b37c937931ea8c36781ff050cee274 100644 (file)
@@ -1054,11 +1054,13 @@ static void php_search_array(INTERNAL_FUNCTION_PARAMETERS, int behavior)
                zend_get_parameters_ex(ZEND_NUM_ARGS(), &value, &array, &strict) == FAILURE) {
                WRONG_PARAM_COUNT;
        }
-       
+
+#ifndef ZEND_ENGINE_2  
        if (Z_TYPE_PP(value) == IS_OBJECT) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong datatype for first argument");
                RETURN_FALSE;
        }
+#endif
        
        if (Z_TYPE_PP(array) != IS_ARRAY) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong datatype for second argument");