? test.php ? ext/iconv/php_have_ibm_iconv.h ? ext/spl/tests/bug44018.phpt Index: ext/spl/spl_array.c =================================================================== RCS file: /repository/php-src/ext/spl/spl_array.c,v retrieving revision 1.71.2.17.2.20 diff -u -p -r1.71.2.17.2.20 spl_array.c --- ext/spl/spl_array.c 18 Oct 2008 09:33:21 -0000 1.71.2.17.2.20 +++ ext/spl/spl_array.c 19 Oct 2008 17:57:35 -0000 @@ -910,9 +910,7 @@ SPL_METHOD(Array, __construct) spl_array_object *intern; zval **array; long ar_flags = 0; - char *class_name; - int class_name_len; - zend_class_entry ** pce_get_iterator; + zend_class_entry * ce_get_iterator = spl_ce_Iterator; if (ZEND_NUM_ARGS() == 0) { return; /* nothing to do */ @@ -921,7 +919,7 @@ SPL_METHOD(Array, __construct) intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|ls", &array, &ar_flags, &class_name, &class_name_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|lC", &array, &ar_flags, &ce_get_iterator) == FAILURE) { php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return; } @@ -931,12 +929,7 @@ SPL_METHOD(Array, __construct) } if (ZEND_NUM_ARGS() > 2) { - if (zend_lookup_class(class_name, class_name_len, &pce_get_iterator TSRMLS_CC) == FAILURE) { - zend_throw_exception(spl_ce_InvalidArgumentException, "A class that implements Iterator must be specified", 0 TSRMLS_CC); - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - return; - } - intern->ce_get_iterator = *pce_get_iterator; + intern->ce_get_iterator = ce_get_iterator; } ar_flags &= ~SPL_ARRAY_INT_MASK; @@ -989,21 +982,14 @@ SPL_METHOD(Array, setIteratorClass) { zval *object = getThis(); spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); - char *class_name; - int class_name_len; - zend_class_entry ** pce_get_iterator; + zend_class_entry * ce_get_iterator = spl_ce_Iterator; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &class_name, &class_name_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "C", &ce_get_iterator) == FAILURE) { php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return; } - if (zend_lookup_class(class_name, class_name_len, &pce_get_iterator TSRMLS_CC) == FAILURE) { - zend_throw_exception(spl_ce_InvalidArgumentException, "A class that implements Iterator must be specified", 0 TSRMLS_CC); - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - return; - } - intern->ce_get_iterator = *pce_get_iterator; + intern->ce_get_iterator = ce_get_iterator; } /* }}} */ Index: ext/spl/tests/arrayObject___construct_error1.phpt =================================================================== RCS file: /repository/php-src/ext/spl/tests/arrayObject___construct_error1.phpt,v retrieving revision 1.1.2.1 diff -u -p -r1.1.2.1 arrayObject___construct_error1.phpt --- ext/spl/tests/arrayObject___construct_error1.phpt 17 Oct 2008 14:26:36 -0000 1.1.2.1 +++ ext/spl/tests/arrayObject___construct_error1.phpt 19 Oct 2008 17:57:35 -0000 @@ -1,7 +1,5 @@ --TEST-- SPL: ArrayObject::__construct with bad iterator. ---XFAIL-- -See bug http://bugs.php.net/bug.php?id=46317 --FILE-- 2 c=>3 string(113) "ArrayObject::__construct() expects parameter 3 to be a class name derived from Iterator, 'nonExistentClass' given" -string(105) "ArrayObject::__construct() expects parameter 3 to be a class name derived from Iterator, 'stdClass' given" \ No newline at end of file +string(105) "ArrayObject::__construct() expects parameter 3 to be a class name derived from Iterator, 'stdClass' given"