[php-src] master: ext/spl: Deprecate ArrayObject and ArrayIterator with objects (#19420)

From: Date: Thu, 14 Aug 2025 11:38:59 +0000
Subject: [php-src] master: ext/spl: Deprecate ArrayObject and ArrayIterator with objects (#19420)
Groups: php.cvs 
Request: Send a blank email to [email protected] to get a copy of this message
Author: Gina Peter Banyard (Girgias)
Committer: GitHub (web-flow)
Pusher: Girgias
Date: 2025-08-14T12:38:57+01:00

Commit: https://github.com/php/php-src/commit/fb87b14b6cb7a3895fb327062805a4a22c4dd909
Raw diff: https://github.com/php/php-src/commit/fb87b14b6cb7a3895fb327062805a4a22c4dd909.diff

ext/spl: Deprecate ArrayObject and ArrayIterator with objects (#19420)

RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_arrayobject_and_arrayiterator_with_objects

This also moves tests into a subfolder.

Changed paths:
  A  ext/spl/tests/ArrayObject/ArrayObject__serialize_saves_iterator_class.phpt
  A  ext/spl/tests/ArrayObject/ArrayObject_clone_other_std_props.phpt
  A  ext/spl/tests/ArrayObject/ArrayObject_dump_during_sort.phpt
  A  ext/spl/tests/ArrayObject/ArrayObject_enum.phpt
  A  ext/spl/tests/ArrayObject/ArrayObject_exchange_array_during_sorting.phpt
  A  ext/spl/tests/ArrayObject/ArrayObject_get_object_vars.phpt
  A  ext/spl/tests/ArrayObject/ArrayObject_illegal_offset.phpt
  A  ext/spl/tests/ArrayObject/ArrayObject_modify_shared_object_properties.phpt
  A  ext/spl/tests/ArrayObject/ArrayObject_overloaded_SplFixedArray.phpt
  A  ext/spl/tests/ArrayObject/ArrayObject_overloaded_object_incompatible.phpt
  A  ext/spl/tests/ArrayObject/ArrayObject_proptable_canonicalization.phpt
  A  ext/spl/tests/ArrayObject/ArrayObject_sort_different_backing_storage.phpt
  A  ext/spl/tests/ArrayObject/ArrayObject_std_props_no_recursion.phpt
  A  ext/spl/tests/ArrayObject/ArrayObject_unserialize_empty_string.phpt
  A  ext/spl/tests/ArrayObject/arrayIterator_ksort_basic1.phpt
  A  ext/spl/tests/ArrayObject/arrayObject___construct_basic1.phpt
  A  ext/spl/tests/ArrayObject/arrayObject___construct_basic2.phpt
  A  ext/spl/tests/ArrayObject/arrayObject___construct_basic3.phpt
  A  ext/spl/tests/ArrayObject/arrayObject___construct_basic4.phpt
  A  ext/spl/tests/ArrayObject/arrayObject___construct_basic5.phpt
  A  ext/spl/tests/ArrayObject/arrayObject___construct_basic6.phpt
  A  ext/spl/tests/ArrayObject/arrayObject___construct_basic7.phpt
  A  ext/spl/tests/ArrayObject/arrayObject___construct_error1.phpt
  A  ext/spl/tests/ArrayObject/arrayObject___construct_error2.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_asort_basic1.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_asort_basic2.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_clone_basic1.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_clone_basic2.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_clone_basic3.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_count_basic1.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_exchangeArray_basic1.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_exchangeArray_basic2.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_exchangeArray_basic3.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_getFlags_basic1.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_getFlags_basic2.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_getIteratorClass_basic1.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_ksort_basic1.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_ksort_basic2.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_magicMethods1.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_magicMethods2.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_magicMethods3.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_magicMethods4.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_magicMethods5.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_magicMethods6.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_natcasesort_basic1.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_natsort_basic1.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_offsetExists_nullcheck.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_setFlags_basic1.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_setFlags_basic2.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_setIteratorClass_error1.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_uasort_basic1.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_uasort_error1.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_uksort_basic1.phpt
  A  ext/spl/tests/ArrayObject/arrayObject_uksort_error1.phpt
  A  ext/spl/tests/ArrayObject/array_001.phpt
  A  ext/spl/tests/ArrayObject/array_002.phpt
  A  ext/spl/tests/ArrayObject/array_003.phpt
  A  ext/spl/tests/ArrayObject/array_004.phpt
  A  ext/spl/tests/ArrayObject/array_005.phpt
  A  ext/spl/tests/ArrayObject/array_006.phpt
  A  ext/spl/tests/ArrayObject/array_007.phpt
  A  ext/spl/tests/ArrayObject/array_008.phpt
  A  ext/spl/tests/ArrayObject/array_009.phpt
  A  ext/spl/tests/ArrayObject/array_009a.phpt
  A  ext/spl/tests/ArrayObject/array_010.phpt
  A  ext/spl/tests/ArrayObject/array_011.phpt
  A  ext/spl/tests/ArrayObject/array_012.phpt
  A  ext/spl/tests/ArrayObject/array_013.phpt
  A  ext/spl/tests/ArrayObject/array_014.phpt
  A  ext/spl/tests/ArrayObject/array_015.phpt
  A  ext/spl/tests/ArrayObject/array_016.phpt
  A  ext/spl/tests/ArrayObject/array_017.phpt
  A  ext/spl/tests/ArrayObject/array_018.phpt
  A  ext/spl/tests/ArrayObject/array_019.phpt
  A  ext/spl/tests/ArrayObject/array_020.phpt
  A  ext/spl/tests/ArrayObject/array_021.phpt
  A  ext/spl/tests/ArrayObject/array_022.phpt
  A  ext/spl/tests/ArrayObject/array_023.phpt
  A  ext/spl/tests/ArrayObject/array_024.phpt
  A  ext/spl/tests/ArrayObject/array_025.phpt
  A  ext/spl/tests/ArrayObject/array_026.phpt
  A  ext/spl/tests/ArrayObject/array_027.phpt
  A  ext/spl/tests/ArrayObject/array_028.phpt
  A  ext/spl/tests/ArrayObject/bug31346.phpt
  A  ext/spl/tests/ArrayObject/bug38618.phpt
  A  ext/spl/tests/ArrayObject/bug41691.phpt
  A  ext/spl/tests/ArrayObject/bug44615.phpt
  A  ext/spl/tests/ArrayObject/bug45614.phpt
  A  ext/spl/tests/ArrayObject/bug54323.phpt
  A  ext/spl/tests/ArrayObject/bug62672.phpt
  A  ext/spl/tests/ArrayObject/bug69845.phpt
  A  ext/spl/tests/ArrayObject/bug70155.phpt
  A  ext/spl/tests/ArrayObject/bug73209.phpt
  A  ext/spl/tests/ArrayObject/bug74669.phpt
  A  ext/spl/tests/ArrayObject/gh10519.phpt
  A  ext/spl/tests/ArrayObject/gh11178.phpt
  A  ext/spl/tests/ArrayObject/gh15833_1.phpt
  A  ext/spl/tests/ArrayObject/gh15833_2.phpt
  A  ext/spl/tests/ArrayObject/gh15918.phpt
  A  ext/spl/tests/ArrayObject/gh16646.phpt
  A  ext/spl/tests/ArrayObject/gh16646_2.phpt
  D  ext/spl/tests/ArrayObject__serialize_saves_iterator_class.phpt
  D  ext/spl/tests/ArrayObject_clone_other_std_props.phpt
  D  ext/spl/tests/ArrayObject_dump_during_sort.phpt
  D  ext/spl/tests/ArrayObject_enum.phpt
  D  ext/spl/tests/ArrayObject_exchange_array_during_sorting.phpt
  D  ext/spl/tests/ArrayObject_get_object_vars.phpt
  D  ext/spl/tests/ArrayObject_illegal_offset.phpt
  D  ext/spl/tests/ArrayObject_modify_shared_object_properties.phpt
  D  ext/spl/tests/ArrayObject_overloaded_SplFixedArray.phpt
  D  ext/spl/tests/ArrayObject_overloaded_object_incompatible.phpt
  D  ext/spl/tests/ArrayObject_proptable_canonicalization.phpt
  D  ext/spl/tests/ArrayObject_sort_different_backing_storage.phpt
  D  ext/spl/tests/ArrayObject_std_props_no_recursion.phpt
  D  ext/spl/tests/ArrayObject_unserialize_empty_string.phpt
  D  ext/spl/tests/arrayIterator_ksort_basic1.phpt
  D  ext/spl/tests/arrayObject___construct_basic1.phpt
  D  ext/spl/tests/arrayObject___construct_basic2.phpt
  D  ext/spl/tests/arrayObject___construct_basic3.phpt
  D  ext/spl/tests/arrayObject___construct_basic4.phpt
  D  ext/spl/tests/arrayObject___construct_basic5.phpt
  D  ext/spl/tests/arrayObject___construct_basic6.phpt
  D  ext/spl/tests/arrayObject___construct_basic7.phpt
  D  ext/spl/tests/arrayObject___construct_error1.phpt
  D  ext/spl/tests/arrayObject___construct_error2.phpt
  D  ext/spl/tests/arrayObject_asort_basic1.phpt
  D  ext/spl/tests/arrayObject_asort_basic2.phpt
  D  ext/spl/tests/arrayObject_clone_basic1.phpt
  D  ext/spl/tests/arrayObject_clone_basic2.phpt
  D  ext/spl/tests/arrayObject_clone_basic3.phpt
  D  ext/spl/tests/arrayObject_count_basic1.phpt
  D  ext/spl/tests/arrayObject_exchangeArray_basic1.phpt
  D  ext/spl/tests/arrayObject_exchangeArray_basic2.phpt
  D  ext/spl/tests/arrayObject_exchangeArray_basic3.phpt
  D  ext/spl/tests/arrayObject_getFlags_basic1.phpt
  D  ext/spl/tests/arrayObject_getFlags_basic2.phpt
  D  ext/spl/tests/arrayObject_getIteratorClass_basic1.phpt
  D  ext/spl/tests/arrayObject_ksort_basic1.phpt
  D  ext/spl/tests/arrayObject_ksort_basic2.phpt
  D  ext/spl/tests/arrayObject_magicMethods1.phpt
  D  ext/spl/tests/arrayObject_magicMethods2.phpt
  D  ext/spl/tests/arrayObject_magicMethods3.phpt
  D  ext/spl/tests/arrayObject_magicMethods4.phpt
  D  ext/spl/tests/arrayObject_magicMethods5.phpt
  D  ext/spl/tests/arrayObject_magicMethods6.phpt
  D  ext/spl/tests/arrayObject_natcasesort_basic1.phpt
  D  ext/spl/tests/arrayObject_natsort_basic1.phpt
  D  ext/spl/tests/arrayObject_offsetExists_nullcheck.phpt
  D  ext/spl/tests/arrayObject_setFlags_basic1.phpt
  D  ext/spl/tests/arrayObject_setFlags_basic2.phpt
  D  ext/spl/tests/arrayObject_setIteratorClass_error1.phpt
  D  ext/spl/tests/arrayObject_uasort_basic1.phpt
  D  ext/spl/tests/arrayObject_uasort_error1.phpt
  D  ext/spl/tests/arrayObject_uksort_basic1.phpt
  D  ext/spl/tests/arrayObject_uksort_error1.phpt
  D  ext/spl/tests/array_001.phpt
  D  ext/spl/tests/array_002.phpt
  D  ext/spl/tests/array_003.phpt
  D  ext/spl/tests/array_004.phpt
  D  ext/spl/tests/array_005.phpt
  D  ext/spl/tests/array_006.phpt
  D  ext/spl/tests/array_007.phpt
  D  ext/spl/tests/array_008.phpt
  D  ext/spl/tests/array_009.phpt
  D  ext/spl/tests/array_009a.phpt
  D  ext/spl/tests/array_010.phpt
  D  ext/spl/tests/array_011.phpt
  D  ext/spl/tests/array_012.phpt
  D  ext/spl/tests/array_013.phpt
  D  ext/spl/tests/array_014.phpt
  D  ext/spl/tests/array_015.phpt
  D  ext/spl/tests/array_016.phpt
  D  ext/spl/tests/array_017.phpt
  D  ext/spl/tests/array_018.phpt
  D  ext/spl/tests/array_019.phpt
  D  ext/spl/tests/array_020.phpt
  D  ext/spl/tests/array_021.phpt
  D  ext/spl/tests/array_022.phpt
  D  ext/spl/tests/array_023.phpt
  D  ext/spl/tests/array_024.phpt
  D  ext/spl/tests/array_025.phpt
  D  ext/spl/tests/array_026.phpt
  D  ext/spl/tests/array_027.phpt
  D  ext/spl/tests/array_028.phpt
  D  ext/spl/tests/bug31346.phpt
  D  ext/spl/tests/bug38618.phpt
  D  ext/spl/tests/bug41691.phpt
  D  ext/spl/tests/bug44615.phpt
  D  ext/spl/tests/bug45614.phpt
  D  ext/spl/tests/bug54323.phpt
  D  ext/spl/tests/bug62672.phpt
  D  ext/spl/tests/bug69845.phpt
  D  ext/spl/tests/bug70155.phpt
  D  ext/spl/tests/bug73209.phpt
  D  ext/spl/tests/bug74669.phpt
  D  ext/spl/tests/gh10519.phpt
  D  ext/spl/tests/gh11178.phpt
  D  ext/spl/tests/gh15833_1.phpt
  D  ext/spl/tests/gh15833_2.phpt
  D  ext/spl/tests/gh15918.phpt
  D  ext/spl/tests/gh16646.phpt
  D  ext/spl/tests/gh16646_2.phpt
  M  Zend/tests/gc/gc_046.phpt
  M  Zend/tests/type_declarations/typed_properties_113.phpt
  M  Zend/tests/type_declarations/typed_properties_114.phpt
  M  Zend/tests/type_declarations/typed_properties_115.phpt
  M  ext/spl/spl_array.c
  M  ext/spl/tests/ArrayObject/property_hooks.phpt
  M  ext/spl/tests/iterator_016.phpt
  M  ext/spl/tests/iterator_069.phpt
  M  ext/spl/tests/iterator_071.phpt
  M  ext/spl/tests/recursiveIteratorIterator_beginchildren_error.phpt
  M  ext/spl/tests/recursiveIteratorIterator_callHasChildren_error.phpt
  M  ext/spl/tests/recursiveIteratorIterator_endchildren_error.phpt
  M  ext/spl/tests/recursiveIteratorIterator_nextelement_error.phpt
  M  ext/spl/tests/recursive_tree_iterator_007.phpt
  M  ext/standard/tests/class_object/get_object_vars_variation_005.phpt
  M  ext/standard/tests/directory/DirectoryClass_readonly_handle_by_pass_via_ArrayObject.phpt


Diff:

diff --git a/Zend/tests/gc/gc_046.phpt b/Zend/tests/gc/gc_046.phpt
index d5024737365b1..8d48438535217 100644
--- a/Zend/tests/gc/gc_046.phpt
+++ b/Zend/tests/gc/gc_046.phpt
@@ -20,5 +20,6 @@ $action->filter();
 $action->filter();
 ?>
 DONE
---EXPECT--
+--EXPECTF--
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 DONE
diff --git a/Zend/tests/type_declarations/typed_properties_113.phpt
b/Zend/tests/type_declarations/typed_properties_113.phpt
index cb5c0f9276453..0aecc76f758a4 100644
--- a/Zend/tests/type_declarations/typed_properties_113.phpt
+++ b/Zend/tests/type_declarations/typed_properties_113.phpt
@@ -19,7 +19,8 @@ foreach ($obj as $k => &$v) {
 
 var_dump($obj);
 ?>
---EXPECT--
+--EXPECTF--
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 object(A)#1 (1) {
   ["foo"]=>
   &string(2) "42"
diff --git a/Zend/tests/type_declarations/typed_properties_114.phpt
b/Zend/tests/type_declarations/typed_properties_114.phpt
index e771f4c1c1f84..5f3093dd33088 100644
--- a/Zend/tests/type_declarations/typed_properties_114.phpt
+++ b/Zend/tests/type_declarations/typed_properties_114.phpt
@@ -30,8 +30,11 @@ foreach ($obj as $k => &$v) {
 
 var_dump($obj);
 ?>
---EXPECT--
+--EXPECTF--
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 Cannot assign array to reference held by property A::$foo of type string
+
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 Cannot assign array to reference held by property A::$foo of type string
 object(A)#1 (1) {
   ["foo"]=>
diff --git a/Zend/tests/type_declarations/typed_properties_115.phpt
b/Zend/tests/type_declarations/typed_properties_115.phpt
index eb96b3ee88641..6347ee0c35d6c 100644
--- a/Zend/tests/type_declarations/typed_properties_115.phpt
+++ b/Zend/tests/type_declarations/typed_properties_115.phpt
@@ -22,7 +22,8 @@ try {
 
 var_dump($obj);
 ?>
---EXPECT--
+--EXPECTF--
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 Cannot acquire reference to readonly property A::$foo
 object(A)#1 (1) {
   ["foo"]=>
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index 5cb3e27bbb861..781872cda117c 100644
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -984,6 +984,12 @@ static void spl_array_set_array(zval *object, spl_array_object *intern, zval
*ar
 			}
 		}
 	} else {
+		php_error_docref(NULL, E_DEPRECATED,
+			"Using an object as a backing array for %s is deprecated, as it allows violating class
constraints and invariants",
+			instanceof_function(Z_OBJCE_P(object), spl_ce_ArrayIterator) ? "ArrayIterator" :
"ArrayObject");
+		if (UNEXPECTED(EG(exception))) {
+			return;
+		}
 		if (Z_OBJ_HT_P(array) == &spl_handler_ArrayObject) {
 			ZVAL_COPY_VALUE(&garbage, &intern->array);
 			if (just_array)	{
diff --git a/ext/spl/tests/ArrayObject__serialize_saves_iterator_class.phpt
b/ext/spl/tests/ArrayObject/ArrayObject__serialize_saves_iterator_class.phpt
similarity index 100%
rename from ext/spl/tests/ArrayObject__serialize_saves_iterator_class.phpt
rename to ext/spl/tests/ArrayObject/ArrayObject__serialize_saves_iterator_class.phpt
diff --git a/ext/spl/tests/ArrayObject_clone_other_std_props.phpt
b/ext/spl/tests/ArrayObject/ArrayObject_clone_other_std_props.phpt
similarity index 64%
rename from ext/spl/tests/ArrayObject_clone_other_std_props.phpt
rename to ext/spl/tests/ArrayObject/ArrayObject_clone_other_std_props.phpt
index 688954c3d7b13..f527f5b664586 100644
--- a/ext/spl/tests/ArrayObject_clone_other_std_props.phpt
+++ b/ext/spl/tests/ArrayObject/ArrayObject_clone_other_std_props.phpt
@@ -9,7 +9,8 @@ $c = clone $b;
 var_dump($c);
 
 ?>
---EXPECT--
+--EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 object(ArrayObject)#3 (1) {
   ["storage":"ArrayObject":private]=>
   array(3) {
diff --git a/ext/spl/tests/ArrayObject_dump_during_sort.phpt
b/ext/spl/tests/ArrayObject/ArrayObject_dump_during_sort.phpt
similarity index 100%
rename from ext/spl/tests/ArrayObject_dump_during_sort.phpt
rename to ext/spl/tests/ArrayObject/ArrayObject_dump_during_sort.phpt
diff --git a/ext/spl/tests/ArrayObject_enum.phpt b/ext/spl/tests/ArrayObject/ArrayObject_enum.phpt
similarity index 57%
rename from ext/spl/tests/ArrayObject_enum.phpt
rename to ext/spl/tests/ArrayObject/ArrayObject_enum.phpt
index 906c89b54dff1..a88da8fc5539c 100644
--- a/ext/spl/tests/ArrayObject_enum.phpt
+++ b/ext/spl/tests/ArrayObject/ArrayObject_enum.phpt
@@ -11,5 +11,7 @@ new ArrayObject(Foo::Bar);
 
 ?>
 --EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+
 Fatal error: Uncaught InvalidArgumentException: Enums are not compatible with ArrayObject in %s:%d
 %a
diff --git a/ext/spl/tests/ArrayObject_exchange_array_during_sorting.phpt
b/ext/spl/tests/ArrayObject/ArrayObject_exchange_array_during_sorting.phpt
similarity index 100%
rename from ext/spl/tests/ArrayObject_exchange_array_during_sorting.phpt
rename to ext/spl/tests/ArrayObject/ArrayObject_exchange_array_during_sorting.phpt
diff --git a/ext/spl/tests/ArrayObject_get_object_vars.phpt
b/ext/spl/tests/ArrayObject/ArrayObject_get_object_vars.phpt
similarity index 69%
rename from ext/spl/tests/ArrayObject_get_object_vars.phpt
rename to ext/spl/tests/ArrayObject/ArrayObject_get_object_vars.phpt
index a80add6b95ad7..2e6b3d27f1566 100644
--- a/ext/spl/tests/ArrayObject_get_object_vars.phpt
+++ b/ext/spl/tests/ArrayObject/ArrayObject_get_object_vars.phpt
@@ -21,7 +21,8 @@ var_dump(get_object_vars($ao));
 var_dump($ao->getObjectVars());
 
 ?>
---EXPECT--
+--EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 array(0) {
 }
 array(1) {
diff --git a/ext/spl/tests/ArrayObject_illegal_offset.phpt
b/ext/spl/tests/ArrayObject/ArrayObject_illegal_offset.phpt
similarity index 100%
rename from ext/spl/tests/ArrayObject_illegal_offset.phpt
rename to ext/spl/tests/ArrayObject/ArrayObject_illegal_offset.phpt
diff --git a/ext/spl/tests/ArrayObject_modify_shared_object_properties.phpt
b/ext/spl/tests/ArrayObject/ArrayObject_modify_shared_object_properties.phpt
similarity index 58%
rename from ext/spl/tests/ArrayObject_modify_shared_object_properties.phpt
rename to ext/spl/tests/ArrayObject/ArrayObject_modify_shared_object_properties.phpt
index 24c247cabd9d0..69424204456b4 100644
--- a/ext/spl/tests/ArrayObject_modify_shared_object_properties.phpt
+++ b/ext/spl/tests/ArrayObject/ArrayObject_modify_shared_object_properties.phpt
@@ -10,7 +10,8 @@ $ao['a'] = 42;
 var_dump($arr);
 
 ?>
---EXPECT--
+--EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 array(2) {
   ["a"]=>
   int(1)
diff --git a/ext/spl/tests/ArrayObject_overloaded_SplFixedArray.phpt
b/ext/spl/tests/ArrayObject/ArrayObject_overloaded_SplFixedArray.phpt
similarity index 69%
rename from ext/spl/tests/ArrayObject_overloaded_SplFixedArray.phpt
rename to ext/spl/tests/ArrayObject/ArrayObject_overloaded_SplFixedArray.phpt
index f46e4cc1c9aa4..13065b4ac38a9 100644
--- a/ext/spl/tests/ArrayObject_overloaded_SplFixedArray.phpt
+++ b/ext/spl/tests/ArrayObject/ArrayObject_overloaded_SplFixedArray.phpt
@@ -12,5 +12,6 @@ try {
   echo $e->getMessage(), "\n";
 }
 ?>
---EXPECT--
+--EXPECTF--
+Deprecated: ArrayObject::exchangeArray(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 Overloaded object of type SplFixedArray is not compatible with ArrayObject
diff --git a/ext/spl/tests/ArrayObject_overloaded_object_incompatible.phpt
b/ext/spl/tests/ArrayObject/ArrayObject_overloaded_object_incompatible.phpt
similarity index 71%
rename from ext/spl/tests/ArrayObject_overloaded_object_incompatible.phpt
rename to ext/spl/tests/ArrayObject/ArrayObject_overloaded_object_incompatible.phpt
index 67267f0ec6a12..8cc66facc0053 100644
--- a/ext/spl/tests/ArrayObject_overloaded_object_incompatible.phpt
+++ b/ext/spl/tests/ArrayObject/ArrayObject_overloaded_object_incompatible.phpt
@@ -12,7 +12,8 @@ try {
 var_dump($ao);
 
 ?>
---EXPECT--
+--EXPECTF--
+Deprecated: ArrayObject::exchangeArray(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 Overloaded object of type DateInterval is not compatible with ArrayObject
 object(ArrayObject)#1 (1) {
   ["storage":"ArrayObject":private]=>
diff --git a/ext/spl/tests/ArrayObject_proptable_canonicalization.phpt
b/ext/spl/tests/ArrayObject/ArrayObject_proptable_canonicalization.phpt
similarity index 57%
rename from ext/spl/tests/ArrayObject_proptable_canonicalization.phpt
rename to ext/spl/tests/ArrayObject/ArrayObject_proptable_canonicalization.phpt
index 006a152602682..fd10797f72b06 100644
--- a/ext/spl/tests/ArrayObject_proptable_canonicalization.phpt
+++ b/ext/spl/tests/ArrayObject/ArrayObject_proptable_canonicalization.phpt
@@ -1,5 +1,5 @@
 --TEST--
-When ArrayObject wraps an object, we should use proptable canonicalization
+When ArrayObject wraps an object, we should use prop table canonicalization
 --FILE--
 <?php
 
@@ -15,7 +15,8 @@ unset($ao[0]);
 var_dump($o);
 
 ?>
---EXPECT--
+--EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 object(stdClass)#1 (1) {
   ["0"]=>
   int(1)
diff --git a/ext/spl/tests/ArrayObject_sort_different_backing_storage.phpt
b/ext/spl/tests/ArrayObject/ArrayObject_sort_different_backing_storage.phpt
similarity index 73%
rename from ext/spl/tests/ArrayObject_sort_different_backing_storage.phpt
rename to ext/spl/tests/ArrayObject/ArrayObject_sort_different_backing_storage.phpt
index 93dd6570791c7..34ecc1018c065 100644
--- a/ext/spl/tests/ArrayObject_sort_different_backing_storage.phpt
+++ b/ext/spl/tests/ArrayObject/ArrayObject_sort_different_backing_storage.phpt
@@ -29,6 +29,7 @@ var_dump($ao5);
 
 ?>
 --EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 object(ArrayObject)#2 (1) {
   ["storage":"ArrayObject":private]=>
   object(stdClass)#1 (2) {
@@ -38,6 +39,8 @@ object(ArrayObject)#2 (1) {
     int(2)
   }
 }
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 object(ArrayObject)#3 (1) {
   ["storage":"ArrayObject":private]=>
   object(ArrayObject)#2 (1) {
@@ -51,6 +54,8 @@ object(ArrayObject)#3 (1) {
   }
 }
 
+Deprecated: ArrayObject::exchangeArray(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+
 Deprecated: Creation of dynamic property ArrayObject::$a is deprecated in %s on line %d
 
 Deprecated: Creation of dynamic property ArrayObject::$b is deprecated in %s on line %d
diff --git a/ext/spl/tests/ArrayObject_std_props_no_recursion.phpt
b/ext/spl/tests/ArrayObject/ArrayObject_std_props_no_recursion.phpt
similarity index 65%
rename from ext/spl/tests/ArrayObject_std_props_no_recursion.phpt
rename to ext/spl/tests/ArrayObject/ArrayObject_std_props_no_recursion.phpt
index 55ec57762fa4e..56f54844580d9 100644
--- a/ext/spl/tests/ArrayObject_std_props_no_recursion.phpt
+++ b/ext/spl/tests/ArrayObject/ArrayObject_std_props_no_recursion.phpt
@@ -16,6 +16,8 @@ var_dump((array) $c);
 --EXPECTF--
 Deprecated: Creation of dynamic property ArrayObject::$prop is deprecated in %s on line %d
 
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+
 Deprecated: Creation of dynamic property ArrayObject::$prop is deprecated in %s on line %d
 array(3) {
   [0]=>
@@ -26,6 +28,8 @@ array(3) {
   int(3)
 }
 
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+
 Deprecated: Creation of dynamic property ArrayObject::$prop is deprecated in %s on line %d
 array(1) {
   ["prop"]=>
diff --git a/ext/spl/tests/ArrayObject_unserialize_empty_string.phpt
b/ext/spl/tests/ArrayObject/ArrayObject_unserialize_empty_string.phpt
similarity index 100%
rename from ext/spl/tests/ArrayObject_unserialize_empty_string.phpt
rename to ext/spl/tests/ArrayObject/ArrayObject_unserialize_empty_string.phpt
diff --git a/ext/spl/tests/arrayIterator_ksort_basic1.phpt
b/ext/spl/tests/ArrayObject/arrayIterator_ksort_basic1.phpt
similarity index 100%
rename from ext/spl/tests/arrayIterator_ksort_basic1.phpt
rename to ext/spl/tests/ArrayObject/arrayIterator_ksort_basic1.phpt
diff --git a/ext/spl/tests/arrayObject___construct_basic1.phpt
b/ext/spl/tests/ArrayObject/arrayObject___construct_basic1.phpt
similarity index 65%
rename from ext/spl/tests/arrayObject___construct_basic1.phpt
rename to ext/spl/tests/ArrayObject/arrayObject___construct_basic1.phpt
index a14166c35e306..744a936276bdc 100644
--- a/ext/spl/tests/arrayObject___construct_basic1.phpt
+++ b/ext/spl/tests/ArrayObject/arrayObject___construct_basic1.phpt
@@ -16,7 +16,7 @@ var_dump(new ArrayObject(array('key1' => 'val1')));
 echo "--> Nested ArrayObject argument:\n";
 var_dump(new ArrayObject(new ArrayObject($a)));
 ?>
---EXPECT--
+--EXPECTF--
 --> No arguments:
 object(ArrayObject)#1 (1) {
   ["storage":"ArrayObject":private]=>
@@ -24,6 +24,8 @@ object(ArrayObject)#1 (1) {
   }
 }
 --> Object argument:
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 object(ArrayObject)#2 (1) {
   ["storage":"ArrayObject":private]=>
   object(stdClass)#1 (1) {
@@ -40,6 +42,10 @@ object(ArrayObject)#2 (1) {
   }
 }
 --> Nested ArrayObject argument:
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 object(ArrayObject)#2 (1) {
   ["storage":"ArrayObject":private]=>
   object(ArrayObject)#3 (1) {
diff --git a/ext/spl/tests/arrayObject___construct_basic2.phpt
b/ext/spl/tests/ArrayObject/arrayObject___construct_basic2.phpt
similarity index 85%
rename from ext/spl/tests/arrayObject___construct_basic2.phpt
rename to ext/spl/tests/ArrayObject/arrayObject___construct_basic2.phpt
index 0d993a14e786b..e1d9718b4e625 100644
--- a/ext/spl/tests/arrayObject___construct_basic2.phpt
+++ b/ext/spl/tests/ArrayObject/arrayObject___construct_basic2.phpt
@@ -48,6 +48,8 @@ function testAccess($c, $ao) {
 ?>
 --EXPECTF--
 --> Access prop on instance of ArrayObject:
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
   - Iteration:
       prop=>C::prop.orig
   - Read:
@@ -78,6 +80,8 @@ object(C)#1 (0) {
 }
 
 --> Access prop on instance of MyArrayObject:
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
   - Iteration:
       prop=>C::prop.orig
   - Read:
diff --git a/ext/spl/tests/arrayObject___construct_basic3.phpt
b/ext/spl/tests/ArrayObject/arrayObject___construct_basic3.phpt
similarity index 86%
rename from ext/spl/tests/arrayObject___construct_basic3.phpt
rename to ext/spl/tests/ArrayObject/arrayObject___construct_basic3.phpt
index 3fb4dda5a6e97..135d87e6a843c 100644
--- a/ext/spl/tests/arrayObject___construct_basic3.phpt
+++ b/ext/spl/tests/ArrayObject/arrayObject___construct_basic3.phpt
@@ -48,6 +48,8 @@ function testAccess($c, $ao) {
 ?>
 --EXPECTF--
 --> Access prop on instance of ArrayObject with ArrayObject::STD_PROP_LIST:
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
   - Iteration:
       prop=>C::prop.orig
   - Read:
@@ -78,6 +80,8 @@ object(C)#1 (0) {
 }
 
 --> Access prop on instance of MyArrayObject with ArrayObject::STD_PROP_LIST:
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
   - Iteration:
       prop=>C::prop.orig
   - Read:
diff --git a/ext/spl/tests/arrayObject___construct_basic4.phpt
b/ext/spl/tests/ArrayObject/arrayObject___construct_basic4.phpt
similarity index 86%
rename from ext/spl/tests/arrayObject___construct_basic4.phpt
rename to ext/spl/tests/ArrayObject/arrayObject___construct_basic4.phpt
index dd8e75af9318c..2aeed29178a03 100644
--- a/ext/spl/tests/arrayObject___construct_basic4.phpt
+++ b/ext/spl/tests/ArrayObject/arrayObject___construct_basic4.phpt
@@ -48,6 +48,8 @@ function testAccess($c, $ao) {
 ?>
 --EXPECTF--
 --> Access prop on instance of ArrayObject with ArrayObject::ARRAY_AS_PROPS:
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
   - Iteration:
       prop=>C::prop.orig
   - Read:
@@ -76,6 +78,8 @@ object(C)#1 (0) {
 }
 
 --> Access prop on instance of MyArrayObject with ArrayObject::ARRAY_AS_PROPS:
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
   - Iteration:
       prop=>C::prop.orig
   - Read:
diff --git a/ext/spl/tests/arrayObject___construct_basic5.phpt
b/ext/spl/tests/ArrayObject/arrayObject___construct_basic5.phpt
similarity index 87%
rename from ext/spl/tests/arrayObject___construct_basic5.phpt
rename to ext/spl/tests/ArrayObject/arrayObject___construct_basic5.phpt
index e10dcd8a8d01b..125f55d06371d 100644
--- a/ext/spl/tests/arrayObject___construct_basic5.phpt
+++ b/ext/spl/tests/ArrayObject/arrayObject___construct_basic5.phpt
@@ -48,6 +48,8 @@ function testAccess($c, $ao) {
 ?>
 --EXPECTF--
 --> Access prop on instance of ArrayObject with
ArrayObject::STD_PROP_LIST|ArrayObject::ARRAY_AS_PROPS:
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
   - Iteration:
       prop=>C::prop.orig
   - Read:
@@ -76,6 +78,8 @@ object(C)#1 (0) {
 }
 
 --> Access prop on instance of MyArrayObject with
ArrayObject::STD_PROP_LIST|ArrayObject::ARRAY_AS_PROPS:
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
   - Iteration:
       prop=>C::prop.orig
   - Read:
diff --git a/ext/spl/tests/arrayObject___construct_basic6.phpt
b/ext/spl/tests/ArrayObject/arrayObject___construct_basic6.phpt
similarity index 100%
rename from ext/spl/tests/arrayObject___construct_basic6.phpt
rename to ext/spl/tests/ArrayObject/arrayObject___construct_basic6.phpt
diff --git a/ext/spl/tests/arrayObject___construct_basic7.phpt
b/ext/spl/tests/ArrayObject/arrayObject___construct_basic7.phpt
similarity index 71%
rename from ext/spl/tests/arrayObject___construct_basic7.phpt
rename to ext/spl/tests/ArrayObject/arrayObject___construct_basic7.phpt
index dd10b5fb6b996..98131c8c6b4da 100644
--- a/ext/spl/tests/arrayObject___construct_basic7.phpt
+++ b/ext/spl/tests/ArrayObject/arrayObject___construct_basic7.phpt
@@ -10,7 +10,8 @@ $ao = new ArrayObject($o);
 $ao->asort();
 var_dump($a, $o, $ao);
 ?>
---EXPECT--
+--EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 array(2) {
   [0]=>
   int(2)
diff --git a/ext/spl/tests/arrayObject___construct_error1.phpt
b/ext/spl/tests/ArrayObject/arrayObject___construct_error1.phpt
similarity index 100%
rename from ext/spl/tests/arrayObject___construct_error1.phpt
rename to ext/spl/tests/ArrayObject/arrayObject___construct_error1.phpt
diff --git a/ext/spl/tests/arrayObject___construct_error2.phpt
b/ext/spl/tests/ArrayObject/arrayObject___construct_error2.phpt
similarity index 100%
rename from ext/spl/tests/arrayObject___construct_error2.phpt
rename to ext/spl/tests/ArrayObject/arrayObject___construct_error2.phpt
diff --git a/ext/spl/tests/arrayObject_asort_basic1.phpt
b/ext/spl/tests/ArrayObject/arrayObject_asort_basic1.phpt
similarity index 100%
rename from ext/spl/tests/arrayObject_asort_basic1.phpt
rename to ext/spl/tests/ArrayObject/arrayObject_asort_basic1.phpt
diff --git a/ext/spl/tests/arrayObject_asort_basic2.phpt
b/ext/spl/tests/ArrayObject/arrayObject_asort_basic2.phpt
similarity index 83%
rename from ext/spl/tests/arrayObject_asort_basic2.phpt
rename to ext/spl/tests/ArrayObject/arrayObject_asort_basic2.phpt
index 21f0dee950070..772b370ad6778 100644
--- a/ext/spl/tests/arrayObject_asort_basic2.phpt
+++ b/ext/spl/tests/ArrayObject/arrayObject_asort_basic2.phpt
@@ -20,8 +20,10 @@ $ao1 = new ArrayObject($c);
 var_dump($ao1->asort());
 var_dump($ao1, $c);
 ?>
---EXPECT--
+--EXPECTF--
 *** Testing ArrayObject::asort() : basic functionality ***
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 bool(true)
 object(ArrayObject)#2 (1) {
   ["storage":"ArrayObject":private]=>
diff --git a/ext/spl/tests/arrayObject_clone_basic1.phpt
b/ext/spl/tests/ArrayObject/arrayObject_clone_basic1.phpt
similarity index 100%
rename from ext/spl/tests/arrayObject_clone_basic1.phpt
rename to ext/spl/tests/ArrayObject/arrayObject_clone_basic1.phpt
diff --git a/ext/spl/tests/arrayObject_clone_basic2.phpt
b/ext/spl/tests/ArrayObject/arrayObject_clone_basic2.phpt
similarity index 84%
rename from ext/spl/tests/arrayObject_clone_basic2.phpt
rename to ext/spl/tests/ArrayObject/arrayObject_clone_basic2.phpt
index b0a82ccfbc34a..9cca59b60a9be 100644
--- a/ext/spl/tests/arrayObject_clone_basic2.phpt
+++ b/ext/spl/tests/ArrayObject/arrayObject_clone_basic2.phpt
@@ -17,7 +17,8 @@ $ao1['new.ao1'] = 'new element added to ao1';
 $ao2['new.ao2'] = 'new element added to ao2';
 var_dump($c, $ao1, $ao2);
 ?>
---EXPECT--
+--EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 object(C)#1 (3) {
   ["p1"]=>
   string(32) "new prop added to c before clone"
diff --git a/ext/spl/tests/arrayObject_clone_basic3.phpt
b/ext/spl/tests/ArrayObject/arrayObject_clone_basic3.phpt
similarity index 86%
rename from ext/spl/tests/arrayObject_clone_basic3.phpt
rename to ext/spl/tests/ArrayObject/arrayObject_clone_basic3.phpt
index 214a2b87b8690..26e633bdd06aa 100644
--- a/ext/spl/tests/arrayObject_clone_basic3.phpt
+++ b/ext/spl/tests/ArrayObject/arrayObject_clone_basic3.phpt
@@ -23,7 +23,10 @@ $clonedOuterArrayObject['new.coAO'] = 'new element added to
$clonedOuterArrayObj
 
 var_dump($wrappedObject, $innerArrayObject, $outerArrayObject, $clonedOuterArrayObject);
 ?>
---EXPECT--
+--EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 object(C)#1 (5) {
   ["p"]=>
   string(9) "C::p.orig"
diff --git a/ext/spl/tests/arrayObject_count_basic1.phpt
b/ext/spl/tests/ArrayObject/arrayObject_count_basic1.phpt
similarity index 100%
rename from ext/spl/tests/arrayObject_count_basic1.phpt
rename to ext/spl/tests/ArrayObject/arrayObject_count_basic1.phpt
diff --git a/ext/spl/tests/arrayObject_exchangeArray_basic1.phpt
b/ext/spl/tests/ArrayObject/arrayObject_exchangeArray_basic1.phpt
similarity index 100%
rename from ext/spl/tests/arrayObject_exchangeArray_basic1.phpt
rename to ext/spl/tests/ArrayObject/arrayObject_exchangeArray_basic1.phpt
diff --git a/ext/spl/tests/arrayObject_exchangeArray_basic2.phpt
b/ext/spl/tests/ArrayObject/arrayObject_exchangeArray_basic2.phpt
similarity index 71%
rename from ext/spl/tests/arrayObject_exchangeArray_basic2.phpt
rename to ext/spl/tests/ArrayObject/arrayObject_exchangeArray_basic2.phpt
index 1f037e90735b7..4ba09cd388f28 100644
--- a/ext/spl/tests/arrayObject_exchangeArray_basic2.phpt
+++ b/ext/spl/tests/ArrayObject/arrayObject_exchangeArray_basic2.phpt
@@ -45,6 +45,8 @@ object(ArrayObject)#%d (1) {
 }
 
 --> exchangeArray(normal object):
+
+Deprecated: ArrayObject::exchangeArray(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 string(18) "normal object prop"
 object(ArrayObject)#%d (1) {
   ["storage":"ArrayObject":private]=>
@@ -55,6 +57,8 @@ object(ArrayObject)#%d (1) {
 }
 
 --> exchangeArray(ArrayObject):
+
+Deprecated: ArrayObject::exchangeArray(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 string(19) "ArrayObject element"
 object(ArrayObject)#%d (1) {
   ["storage":"ArrayObject":private]=>
@@ -68,6 +72,8 @@ object(ArrayObject)#%d (1) {
 }
 
 --> exchangeArray(ArrayIterator):
+
+Deprecated: ArrayObject::exchangeArray(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 string(21) "ArrayIterator element"
 object(ArrayObject)#%d (1) {
   ["storage":"ArrayObject":private]=>
@@ -81,6 +87,10 @@ object(ArrayObject)#%d (1) {
 }
 
 --> exchangeArray(nested ArrayObject):
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+
+Deprecated: ArrayObject::exchangeArray(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 string(26) "nested ArrayObject element"
 object(ArrayObject)#%d (1) {
   ["storage":"ArrayObject":private]=>
@@ -94,4 +104,4 @@ object(ArrayObject)#%d (1) {
       }
     }
   }
-}
+}
\ No newline at end of file
diff --git a/ext/spl/tests/arrayObject_exchangeArray_basic3.phpt
b/ext/spl/tests/ArrayObject/arrayObject_exchangeArray_basic3.phpt
similarity index 71%
rename from ext/spl/tests/arrayObject_exchangeArray_basic3.phpt
rename to ext/spl/tests/ArrayObject/arrayObject_exchangeArray_basic3.phpt
index 49b990be8bdf2..8db9b016fda86 100644
--- a/ext/spl/tests/arrayObject_exchangeArray_basic3.phpt
+++ b/ext/spl/tests/ArrayObject/arrayObject_exchangeArray_basic3.phpt
@@ -3,7 +3,7 @@ SPL: ArrayObject::exchangeArray() basic usage with object as underlying data sto
 --FILE--
 <?php
 
-#[AllowDynamicProperties]
+#%dAllowDynamicProperties]
 class C {
     public $pub1 = 'public1';
 }
@@ -52,6 +52,14 @@ var_dump($ao, $original, $copy);
 ?>
 --EXPECTF--
 --> exchangeArray() with objects:
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+
+Deprecated: ArrayObject::exchangeArray(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+
+Deprecated: Creation of dynamic property C::$addedToSwapIn is deprecated in %s on line %d
+
+Deprecated: Creation of dynamic property C::$addedToOriginal is deprecated in %s on line %d
 object(ArrayObject)#2 (1) {
   ["storage":"ArrayObject":private]=>
   object(C)#3 (2) {
@@ -82,8 +90,12 @@ array(2) {
 
 
 --> exchangeArray() with no arg:
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 Exception: ArrayObject::exchangeArray() expects exactly 1 argument, 0 given
 
+Deprecated: Creation of dynamic property C::$addedToOriginal is deprecated in %s on line %d
+
 Warning: Undefined variable $copy in %s on line %d
 object(ArrayObject)#2 (1) {
   ["storage":"ArrayObject":private]=>
@@ -104,8 +116,12 @@ NULL
 
 
 --> exchangeArray() with bad arg type:
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 ArrayObject::exchangeArray(): Argument #1 ($array) must be of type array, null given
 
+Deprecated: Creation of dynamic property C::$addedToOriginal is deprecated in %s on line %d
+
 Warning: Undefined variable $copy in %s on line %d
 object(ArrayObject)#3 (1) {
   ["storage":"ArrayObject":private]=>
diff --git a/ext/spl/tests/ArrayObject/arrayObject_getFlags_basic1.phpt
b/ext/spl/tests/ArrayObject/arrayObject_getFlags_basic1.phpt
new file mode 100644
index 0000000000000..35ae39862111a
--- /dev/null
+++ b/ext/spl/tests/ArrayObject/arrayObject_getFlags_basic1.phpt
@@ -0,0 +1,36 @@
+--TEST--
+SPL: ArrayObject::getFlags() basic usage
+--FILE--
+<?php
+$ao = new ArrayObject(new ArrayObject(new stdClass));
+var_dump($ao->getFlags());
+
+$ao = new ArrayObject(new ArrayObject(array(1,2,3)), ArrayObject::STD_PROP_LIST);
+var_dump($ao->getFlags());
+
+$ao = new ArrayObject(new ArrayIterator(new ArrayObject()), ArrayObject::ARRAY_AS_PROPS);
+var_dump($ao->getFlags());
+
+$ao = new ArrayObject(new ArrayObject(), ArrayObject::STD_PROP_LIST|ArrayObject::ARRAY_AS_PROPS);
+var_dump($ao->getFlags());
+
+$cao = clone $ao;
+var_dump($cao->getFlags());
+?>
+--EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+int(0)
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+int(1)
+
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+int(2)
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+int(3)
+int(3)
diff --git a/ext/spl/tests/ArrayObject/arrayObject_getFlags_basic2.phpt
b/ext/spl/tests/ArrayObject/arrayObject_getFlags_basic2.phpt
new file mode 100644
index 0000000000000..0d0111edd1ecb
--- /dev/null
+++ b/ext/spl/tests/ArrayObject/arrayObject_getFlags_basic2.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SPL: ArrayObject::getFlags() - ensure flags are passed on to nested array objects and iterators.
+--FILE--
+<?php
+$ao = new ArrayObject(array(), ArrayObject::STD_PROP_LIST|ArrayObject::ARRAY_AS_PROPS);
+var_dump($ao->getFlags());
+
+$ao2 = new ArrayObject($ao);
+var_dump($ao2->getFlags());
+var_dump($ao2->getIterator()->getFlags());
+
+$ai = new ArrayIterator($ao);
+var_dump($ai->getFlags());
+
+$ao2 = new ArrayObject($ao, 0);
+var_dump($ao2->getFlags());
+
+?>
+--EXPECTF--
+int(3)
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+int(3)
+int(3)
+
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+int(3)
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+int(0)
diff --git a/ext/spl/tests/arrayObject_getIteratorClass_basic1.phpt
b/ext/spl/tests/ArrayObject/arrayObject_getIteratorClass_basic1.phpt
similarity index 100%
rename from ext/spl/tests/arrayObject_getIteratorClass_basic1.phpt
rename to ext/spl/tests/ArrayObject/arrayObject_getIteratorClass_basic1.phpt
diff --git a/ext/spl/tests/arrayObject_ksort_basic1.phpt
b/ext/spl/tests/ArrayObject/arrayObject_ksort_basic1.phpt
similarity index 100%
rename from ext/spl/tests/arrayObject_ksort_basic1.phpt
rename to ext/spl/tests/ArrayObject/arrayObject_ksort_basic1.phpt
diff --git a/ext/spl/tests/arrayObject_ksort_basic2.phpt
b/ext/spl/tests/ArrayObject/arrayObject_ksort_basic2.phpt
similarity index 82%
rename from ext/spl/tests/arrayObject_ksort_basic2.phpt
rename to ext/spl/tests/ArrayObject/arrayObject_ksort_basic2.phpt
index 1ac3029543d8d..6e64a1c64f0d1 100644
--- a/ext/spl/tests/arrayObject_ksort_basic2.phpt
+++ b/ext/spl/tests/ArrayObject/arrayObject_ksort_basic2.phpt
@@ -20,8 +20,10 @@ $ao1 = new ArrayObject($c);
 var_dump($ao1->ksort());
 var_dump($ao1, $c);
 ?>
---EXPECT--
+--EXPECTF--
 *** Testing ArrayObject::ksort() : basic functionality ***
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 bool(true)
 object(ArrayObject)#2 (1) {
   ["storage":"ArrayObject":private]=>
diff --git a/ext/spl/tests/arrayObject_magicMethods1.phpt
b/ext/spl/tests/ArrayObject/arrayObject_magicMethods1.phpt
similarity index 95%
rename from ext/spl/tests/arrayObject_magicMethods1.phpt
rename to ext/spl/tests/ArrayObject/arrayObject_magicMethods1.phpt
index ce29beb7177fb..7acf8787d4ab2 100644
--- a/ext/spl/tests/arrayObject_magicMethods1.phpt
+++ b/ext/spl/tests/ArrayObject/arrayObject_magicMethods1.phpt
@@ -68,6 +68,8 @@ echo "  Wrapping ArrayObject:\n";
 var_dump($ao);
 ?>
 --EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+
 --> Write existent, non-existent and dynamic:
   Original wrapped object:
 object(UsesMagic)#1 (5) {
diff --git a/ext/spl/tests/arrayObject_magicMethods2.phpt
b/ext/spl/tests/ArrayObject/arrayObject_magicMethods2.phpt
similarity index 95%
rename from ext/spl/tests/arrayObject_magicMethods2.phpt
rename to ext/spl/tests/ArrayObject/arrayObject_magicMethods2.phpt
index d28c234d54f94..da3cb624b9b55 100644
--- a/ext/spl/tests/arrayObject_magicMethods2.phpt
+++ b/ext/spl/tests/ArrayObject/arrayObject_magicMethods2.phpt
@@ -68,6 +68,8 @@ echo "  Wrapping ArrayObject:\n";
 var_dump($ao);
 ?>
 --EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+
 --> Write existent, non-existent and dynamic:
 
 Deprecated: Creation of dynamic property ArrayObject::$a is deprecated in %s on line %d
diff --git a/ext/spl/tests/arrayObject_magicMethods3.phpt
b/ext/spl/tests/ArrayObject/arrayObject_magicMethods3.phpt
similarity index 95%
rename from ext/spl/tests/arrayObject_magicMethods3.phpt
rename to ext/spl/tests/ArrayObject/arrayObject_magicMethods3.phpt
index 2ff0531e01d43..04ecfde195e7e 100644
--- a/ext/spl/tests/arrayObject_magicMethods3.phpt
+++ b/ext/spl/tests/ArrayObject/arrayObject_magicMethods3.phpt
@@ -68,6 +68,8 @@ echo "  Wrapping ArrayObject:\n";
 var_dump($ao);
 ?>
 --EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+
 --> Write existent, non-existent and dynamic:
   Original wrapped object:
 object(UsesMagic)#1 (5) {
diff --git a/ext/spl/tests/arrayObject_magicMethods4.phpt
b/ext/spl/tests/ArrayObject/arrayObject_magicMethods4.phpt
similarity index 96%
rename from ext/spl/tests/arrayObject_magicMethods4.phpt
rename to ext/spl/tests/ArrayObject/arrayObject_magicMethods4.phpt
index e68ef1fc47777..a4dabb86ec7cb 100644
--- a/ext/spl/tests/arrayObject_magicMethods4.phpt
+++ b/ext/spl/tests/ArrayObject/arrayObject_magicMethods4.phpt
@@ -71,6 +71,8 @@ echo "  Wrapping ArrayObject:\n";
 var_dump($ao);
 ?>
 --EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+
 --> Write existent, non-existent and dynamic:
   Original wrapped object:
 object(C)#1 (5) {
diff --git a/ext/spl/tests/arrayObject_magicMethods5.phpt
b/ext/spl/tests/ArrayObject/arrayObject_magicMethods5.phpt
similarity index 95%
rename from ext/spl/tests/arrayObject_magicMethods5.phpt
rename to ext/spl/tests/ArrayObject/arrayObject_magicMethods5.phpt
index c0393ffea48fc..569d9c0bb543f 100644
--- a/ext/spl/tests/arrayObject_magicMethods5.phpt
+++ b/ext/spl/tests/ArrayObject/arrayObject_magicMethods5.phpt
@@ -70,7 +70,9 @@ var_dump($obj);
 echo "  Wrapping ArrayObject:\n";
 var_dump($ao);
 ?>
---EXPECT--
+--EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+
 --> Write existent, non-existent and dynamic:
 In UsesMagic::__set(a,changed)
 In UsesMagic::__set(dynamic,new)
diff --git a/ext/spl/tests/arrayObject_magicMethods6.phpt
b/ext/spl/tests/ArrayObject/arrayObject_magicMethods6.phpt
similarity index 96%
rename from ext/spl/tests/arrayObject_magicMethods6.phpt
rename to ext/spl/tests/ArrayObject/arrayObject_magicMethods6.phpt
index 75151902210fb..ae4379c090948 100644
--- a/ext/spl/tests/arrayObject_magicMethods6.phpt
+++ b/ext/spl/tests/ArrayObject/arrayObject_magicMethods6.phpt
@@ -71,6 +71,8 @@ echo "  Wrapping ArrayObject:\n";
 var_dump($ao);
 ?>
 --EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+
 --> Write existent, non-existent and dynamic:
   Original wrapped object:
 object(C)#1 (5) {
diff --git a/ext/spl/tests/arrayObject_natcasesort_basic1.phpt
b/ext/spl/tests/ArrayObject/arrayObject_natcasesort_basic1.phpt
similarity index 100%
rename from ext/spl/tests/arrayObject_natcasesort_basic1.phpt
rename to ext/spl/tests/ArrayObject/arrayObject_natcasesort_basic1.phpt
diff --git a/ext/spl/tests/arrayObject_natsort_basic1.phpt
b/ext/spl/tests/ArrayObject/arrayObject_natsort_basic1.phpt
similarity index 100%
rename from ext/spl/tests/arrayObject_natsort_basic1.phpt
rename to ext/spl/tests/ArrayObject/arrayObject_natsort_basic1.phpt
diff --git a/ext/spl/tests/arrayObject_offsetExists_nullcheck.phpt
b/ext/spl/tests/ArrayObject/arrayObject_offsetExists_nullcheck.phpt
similarity index 100%
rename from ext/spl/tests/arrayObject_offsetExists_nullcheck.phpt
rename to ext/spl/tests/ArrayObject/arrayObject_offsetExists_nullcheck.phpt
diff --git a/ext/spl/tests/arrayObject_setFlags_basic1.phpt
b/ext/spl/tests/ArrayObject/arrayObject_setFlags_basic1.phpt
similarity index 100%
rename from ext/spl/tests/arrayObject_setFlags_basic1.phpt
rename to ext/spl/tests/ArrayObject/arrayObject_setFlags_basic1.phpt
diff --git a/ext/spl/tests/arrayObject_setFlags_basic2.phpt
b/ext/spl/tests/ArrayObject/arrayObject_setFlags_basic2.phpt
similarity index 100%
rename from ext/spl/tests/arrayObject_setFlags_basic2.phpt
rename to ext/spl/tests/ArrayObject/arrayObject_setFlags_basic2.phpt
diff --git a/ext/spl/tests/arrayObject_setIteratorClass_error1.phpt
b/ext/spl/tests/ArrayObject/arrayObject_setIteratorClass_error1.phpt
similarity index 100%
rename from ext/spl/tests/arrayObject_setIteratorClass_error1.phpt
rename to ext/spl/tests/ArrayObject/arrayObject_setIteratorClass_error1.phpt
diff --git a/ext/spl/tests/arrayObject_uasort_basic1.phpt
b/ext/spl/tests/ArrayObject/arrayObject_uasort_basic1.phpt
similarity index 100%
rename from ext/spl/tests/arrayObject_uasort_basic1.phpt
rename to ext/spl/tests/ArrayObject/arrayObject_uasort_basic1.phpt
diff --git a/ext/spl/tests/arrayObject_uasort_error1.phpt
b/ext/spl/tests/ArrayObject/arrayObject_uasort_error1.phpt
similarity index 100%
rename from ext/spl/tests/arrayObject_uasort_error1.phpt
rename to ext/spl/tests/ArrayObject/arrayObject_uasort_error1.phpt
diff --git a/ext/spl/tests/arrayObject_uksort_basic1.phpt
b/ext/spl/tests/ArrayObject/arrayObject_uksort_basic1.phpt
similarity index 100%
rename from ext/spl/tests/arrayObject_uksort_basic1.phpt
rename to ext/spl/tests/ArrayObject/arrayObject_uksort_basic1.phpt
diff --git a/ext/spl/tests/arrayObject_uksort_error1.phpt
b/ext/spl/tests/ArrayObject/arrayObject_uksort_error1.phpt
similarity index 100%
rename from ext/spl/tests/arrayObject_uksort_error1.phpt
rename to ext/spl/tests/ArrayObject/arrayObject_uksort_error1.phpt
diff --git a/ext/spl/tests/array_001.phpt b/ext/spl/tests/ArrayObject/array_001.phpt
similarity index 100%
rename from ext/spl/tests/array_001.phpt
rename to ext/spl/tests/ArrayObject/array_001.phpt
diff --git a/ext/spl/tests/array_002.phpt b/ext/spl/tests/ArrayObject/array_002.phpt
similarity index 78%
rename from ext/spl/tests/array_002.phpt
rename to ext/spl/tests/ArrayObject/array_002.phpt
index 94559f5bf7558..a305770edf90c 100644
--- a/ext/spl/tests/array_002.phpt
+++ b/ext/spl/tests/ArrayObject/array_002.phpt
@@ -18,6 +18,7 @@ var_dump($arrayObject);
 
 ?>
 --EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 object(ArrayObject)#%d (1) {
   ["storage":"ArrayObject":private]=>
   object(ArrayObject)#1 (1) {
diff --git a/ext/spl/tests/array_003.phpt b/ext/spl/tests/ArrayObject/array_003.phpt
similarity index 84%
rename from ext/spl/tests/array_003.phpt
rename to ext/spl/tests/ArrayObject/array_003.phpt
index 3ca23f09dc7ce..38db056250497 100644
--- a/ext/spl/tests/array_003.phpt
+++ b/ext/spl/tests/ArrayObject/array_003.phpt
@@ -35,7 +35,7 @@ foreach($test as $key => $val)
 }
 
 ?>
---EXPECT--
+--EXPECTF--
 test Object
 (
     [pub] => public
@@ -44,6 +44,8 @@ test Object
     [imp] => implicit
     [dyn] => dynamic
 )
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 ArrayObject Object
 (
     [storage:ArrayObject:private] => test Object
diff --git a/ext/spl/tests/array_004.phpt b/ext/spl/tests/ArrayObject/array_004.phpt
similarity index 100%
rename from ext/spl/tests/array_004.phpt
rename to ext/spl/tests/ArrayObject/array_004.phpt
diff --git a/ext/spl/tests/array_005.phpt b/ext/spl/tests/ArrayObject/array_005.phpt
similarity index 100%
rename from ext/spl/tests/array_005.phpt
rename to ext/spl/tests/ArrayObject/array_005.phpt
diff --git a/ext/spl/tests/array_006.phpt b/ext/spl/tests/ArrayObject/array_006.phpt
similarity index 100%
rename from ext/spl/tests/array_006.phpt
rename to ext/spl/tests/ArrayObject/array_006.phpt
diff --git a/ext/spl/tests/array_007.phpt b/ext/spl/tests/ArrayObject/array_007.phpt
similarity index 78%
rename from ext/spl/tests/array_007.phpt
rename to ext/spl/tests/ArrayObject/array_007.phpt
index 3cdd40a1dbc70..de492257c65f4 100644
--- a/ext/spl/tests/array_007.phpt
+++ b/ext/spl/tests/ArrayObject/array_007.phpt
@@ -39,7 +39,7 @@ foreach($test as $key => $val)
 }
 
 ?>
---EXPECT--
+--EXPECTF--
 test Object
 (
     [pub] => public
@@ -48,6 +48,8 @@ test Object
     [imp] => implicit
     [dyn] => dynamic
 )
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 ArrayIterator Object
 (
     [storage:ArrayIterator:private] => ArrayObject Object
@@ -64,6 +66,8 @@ ArrayIterator Object
         )
 
 )
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 pub => public
 imp => implicit
 dyn => dynamic
diff --git a/ext/spl/tests/array_008.phpt b/ext/spl/tests/ArrayObject/array_008.phpt
similarity index 100%
rename from ext/spl/tests/array_008.phpt
rename to ext/spl/tests/ArrayObject/array_008.phpt
diff --git a/ext/spl/tests/array_009.phpt b/ext/spl/tests/ArrayObject/array_009.phpt
similarity index 100%
rename from ext/spl/tests/array_009.phpt
rename to ext/spl/tests/ArrayObject/array_009.phpt
diff --git a/ext/spl/tests/array_009a.phpt b/ext/spl/tests/ArrayObject/array_009a.phpt
similarity index 100%
rename from ext/spl/tests/array_009a.phpt
rename to ext/spl/tests/ArrayObject/array_009a.phpt
diff --git a/ext/spl/tests/array_010.phpt b/ext/spl/tests/ArrayObject/array_010.phpt
similarity index 100%
rename from ext/spl/tests/array_010.phpt
rename to ext/spl/tests/ArrayObject/array_010.phpt
diff --git a/ext/spl/tests/array_011.phpt b/ext/spl/tests/ArrayObject/array_011.phpt
similarity index 100%
rename from ext/spl/tests/array_011.phpt
rename to ext/spl/tests/ArrayObject/array_011.phpt
diff --git a/ext/spl/tests/array_012.phpt b/ext/spl/tests/ArrayObject/array_012.phpt
similarity index 79%
rename from ext/spl/tests/array_012.phpt
rename to ext/spl/tests/ArrayObject/array_012.phpt
index 5d5993d936947..f3b0fa9813b0c 100644
--- a/ext/spl/tests/array_012.phpt
+++ b/ext/spl/tests/ArrayObject/array_012.phpt
@@ -39,7 +39,7 @@ foreach($it as $key => $val)
 var_dump($it->count());
 
 ?>
---EXPECT--
+--EXPECTF--
 ===Array===
 int(3)
 zero=>0
@@ -50,6 +50,8 @@ two=>2
 int(3)
 int(3)
 ===Object===
+
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 int(3)
 zero=>0
 int(3)
diff --git a/ext/spl/tests/array_013.phpt b/ext/spl/tests/ArrayObject/array_013.phpt
similarity index 87%
rename from ext/spl/tests/array_013.phpt
rename to ext/spl/tests/ArrayObject/array_013.phpt
index 9ad11c8f38c79..01097bac04dc1 100644
--- a/ext/spl/tests/array_013.phpt
+++ b/ext/spl/tests/ArrayObject/array_013.phpt
@@ -70,6 +70,8 @@ var_dump($o->{0}); /* doesn't wotk anyway */
 3=>three
 4=>four
 ===Object===
+
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 zero=>0
 one=>1
 two=>2
diff --git a/ext/spl/tests/array_014.phpt b/ext/spl/tests/ArrayObject/array_014.phpt
similarity index 100%
rename from ext/spl/tests/array_014.phpt
rename to ext/spl/tests/ArrayObject/array_014.phpt
diff --git a/ext/spl/tests/array_015.phpt b/ext/spl/tests/ArrayObject/array_015.phpt
similarity index 100%
rename from ext/spl/tests/array_015.phpt
rename to ext/spl/tests/ArrayObject/array_015.phpt
diff --git a/ext/spl/tests/array_016.phpt b/ext/spl/tests/ArrayObject/array_016.phpt
similarity index 100%
rename from ext/spl/tests/array_016.phpt
rename to ext/spl/tests/ArrayObject/array_016.phpt
diff --git a/ext/spl/tests/array_017.phpt b/ext/spl/tests/ArrayObject/array_017.phpt
similarity index 88%
rename from ext/spl/tests/array_017.phpt
rename to ext/spl/tests/ArrayObject/array_017.phpt
index ba4842dce20c9..2a80386b6f73c 100644
--- a/ext/spl/tests/array_017.phpt
+++ b/ext/spl/tests/ArrayObject/array_017.phpt
@@ -177,6 +177,8 @@ array(3) {
 ArrayObjectEx::show()
 ArrayObjectEx::getIterator()
 ArrayIteratorEx::__construct()
+
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 ArrayIteratorEx::dump()
 array(3) {
   ["Flags"]=>
@@ -245,6 +247,8 @@ array(1) {
 ===FOREACH===
 ArrayObjectEx::getIterator()
 ArrayIteratorEx::__construct()
+
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 ArrayIteratorEx::dump()
 array(3) {
   ["Flags"]=>
@@ -366,6 +370,8 @@ array(3) {
 ArrayObjectEx::show()
 ArrayObjectEx::getIterator()
 ArrayIteratorEx::__construct()
+
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 ArrayIteratorEx::dump()
 array(3) {
   ["Flags"]=>
@@ -434,6 +440,8 @@ array(1) {
 ===FOREACH===
 ArrayObjectEx::getIterator()
 ArrayIteratorEx::__construct()
+
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 ArrayIteratorEx::dump()
 array(3) {
   ["Flags"]=>
@@ -512,6 +520,8 @@ int(1)
 bool(true)
 #####EXCHANGE#####
 ArrayObjectEx::exchange()
+
+Deprecated: ArrayObject::exchangeArray(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 ===CHECK===
 ArrayObjectEx::setFlags(0)
 ArrayObjectEx::dump()
@@ -548,6 +558,8 @@ array(3) {
 ArrayObjectEx::show()
 ArrayObjectEx::getIterator()
 ArrayIteratorEx::__construct()
+
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 ArrayIteratorEx::dump()
 array(3) {
   ["Flags"]=>
@@ -607,6 +619,8 @@ array(1) {
 ===FOREACH===
 ArrayObjectEx::getIterator()
 ArrayIteratorEx::__construct()
+
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 ArrayIteratorEx::dump()
 array(3) {
   ["Flags"]=>
@@ -710,6 +724,8 @@ array(3) {
 ArrayObjectEx::show()
 ArrayObjectEx::getIterator()
 ArrayIteratorEx::__construct()
+
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 ArrayIteratorEx::dump()
 array(3) {
   ["Flags"]=>
@@ -769,6 +785,8 @@ array(1) {
 ===FOREACH===
 ArrayObjectEx::getIterator()
 ArrayIteratorEx::__construct()
+
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 ArrayIteratorEx::dump()
 array(3) {
   ["Flags"]=>
diff --git a/ext/spl/tests/array_018.phpt b/ext/spl/tests/ArrayObject/array_018.phpt
similarity index 100%
rename from ext/spl/tests/array_018.phpt
rename to ext/spl/tests/ArrayObject/array_018.phpt
diff --git a/ext/spl/tests/array_019.phpt b/ext/spl/tests/ArrayObject/array_019.phpt
similarity index 100%
rename from ext/spl/tests/array_019.phpt
rename to ext/spl/tests/ArrayObject/array_019.phpt
diff --git a/ext/spl/tests/array_020.phpt b/ext/spl/tests/ArrayObject/array_020.phpt
similarity index 100%
rename from ext/spl/tests/array_020.phpt
rename to ext/spl/tests/ArrayObject/array_020.phpt
diff --git a/ext/spl/tests/array_021.phpt b/ext/spl/tests/ArrayObject/array_021.phpt
similarity index 100%
rename from ext/spl/tests/array_021.phpt
rename to ext/spl/tests/ArrayObject/array_021.phpt
diff --git a/ext/spl/tests/array_022.phpt b/ext/spl/tests/ArrayObject/array_022.phpt
similarity index 72%
rename from ext/spl/tests/array_022.phpt
rename to ext/spl/tests/ArrayObject/array_022.phpt
index f7407bf602c75..4e8c94fd11815 100644
--- a/ext/spl/tests/array_022.phpt
+++ b/ext/spl/tests/ArrayObject/array_022.phpt
@@ -45,6 +45,8 @@ var_dump($b);
 ?>
 --EXPECTF--
 ==ArrayObject===
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 object(MyArrayObject)#%d (1) {
   ["bar"]=>
   string(3) "baz"
@@ -56,6 +58,8 @@ object(MyArrayObject)#%d (2) {
   string(3) "Foo"
 }
 ==ArrayIterator===
+
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 object(MyArrayIterator)#%d (1) {
   ["bar"]=>
   string(3) "baz"
diff --git a/ext/spl/tests/array_023.phpt b/ext/spl/tests/ArrayObject/array_023.phpt
similarity index 100%
rename from ext/spl/tests/array_023.phpt
rename to ext/spl/tests/ArrayObject/array_023.phpt
diff --git a/ext/spl/tests/array_024.phpt b/ext/spl/tests/ArrayObject/array_024.phpt
similarity index 100%
rename from ext/spl/tests/array_024.phpt
rename to ext/spl/tests/ArrayObject/array_024.phpt
diff --git a/ext/spl/tests/array_025.phpt b/ext/spl/tests/ArrayObject/array_025.phpt
similarity index 69%
rename from ext/spl/tests/array_025.phpt
rename to ext/spl/tests/ArrayObject/array_025.phpt
index d64f8f04c1e14..4bd4c434f4804 100644
--- a/ext/spl/tests/array_025.phpt
+++ b/ext/spl/tests/ArrayObject/array_025.phpt
@@ -10,7 +10,10 @@ print_r($obj1);
 echo "$s\n";
 print_r($obj2);
 ?>
---EXPECT--
+--EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+
+Deprecated: ArrayObject::__unserialize(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 ArrayObject Object
 (
     [storage:ArrayObject:private] => ArrayObject Object
diff --git a/ext/spl/tests/array_026.phpt b/ext/spl/tests/ArrayObject/array_026.phpt
similarity index 100%
rename from ext/spl/tests/array_026.phpt
rename to ext/spl/tests/ArrayObject/array_026.phpt
diff --git a/ext/spl/tests/array_027.phpt b/ext/spl/tests/ArrayObject/array_027.phpt
similarity index 100%
rename from ext/spl/tests/array_027.phpt
rename to ext/spl/tests/ArrayObject/array_027.phpt
diff --git a/ext/spl/tests/array_028.phpt b/ext/spl/tests/ArrayObject/array_028.phpt
similarity index 66%
rename from ext/spl/tests/array_028.phpt
rename to ext/spl/tests/ArrayObject/array_028.phpt
index 1adcdd3f90714..1e422fe2f990b 100644
--- a/ext/spl/tests/array_028.phpt
+++ b/ext/spl/tests/ArrayObject/array_028.phpt
@@ -21,7 +21,9 @@ foreach ($obj as $v) {
     var_dump($v);
 }
 ?>
---EXPECT--
+--EXPECTF--
 string(3) "bar"
 string(3) "bar"
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 string(3) "bar"
diff --git a/ext/spl/tests/bug31346.phpt b/ext/spl/tests/ArrayObject/bug31346.phpt
similarity index 54%
rename from ext/spl/tests/bug31346.phpt
rename to ext/spl/tests/ArrayObject/bug31346.phpt
index b2d29905ac767..a1088dfd013e8 100644
--- a/ext/spl/tests/bug31346.phpt
+++ b/ext/spl/tests/ArrayObject/bug31346.phpt
@@ -14,5 +14,6 @@ $i->next();
 
 ?>
 ===DONE===
---EXPECT--
+--EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 ===DONE===
diff --git a/ext/spl/tests/bug38618.phpt b/ext/spl/tests/ArrayObject/bug38618.phpt
similarity index 69%
rename from ext/spl/tests/bug38618.phpt
rename to ext/spl/tests/ArrayObject/bug38618.phpt
index 71a09111a4b8b..5a865f12d636e 100644
--- a/ext/spl/tests/bug38618.phpt
+++ b/ext/spl/tests/ArrayObject/bug38618.phpt
@@ -84,14 +84,22 @@ test_array($array, 'Protected Property');
 test_array($array, 'Public Property New', RecursiveArrayIterator::CHILD_ARRAYS_ONLY);
 test_array($array, 'Protected Property New', RecursiveArrayIterator::CHILD_ARRAYS_ONLY);
 ?>
---EXPECT--
+--EXPECTF--
 ===Default with array===
 1 => apple
 1 => grape
 ===Public Property===
+
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 title => apple
+
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 title => grape
 ===Protected Property===
+
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 ===Public Property New===
 1 => apple
 1 => grape
diff --git a/ext/spl/tests/bug41691.phpt b/ext/spl/tests/ArrayObject/bug41691.phpt
similarity index 70%
rename from ext/spl/tests/bug41691.phpt
rename to ext/spl/tests/ArrayObject/bug41691.phpt
index 93af430b4884a..c808d59c2022f 100644
--- a/ext/spl/tests/bug41691.phpt
+++ b/ext/spl/tests/ArrayObject/bug41691.phpt
@@ -17,7 +17,8 @@
var_dump($a->exchangeArray(array('a'=>1,'b'=>1,'c'=>1)));
 
 echo "Done\n";
 ?>
---EXPECT--
+--EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 array(3) {
   ["a"]=>
   NULL
diff --git a/ext/spl/tests/bug44615.phpt b/ext/spl/tests/ArrayObject/bug44615.phpt
similarity index 76%
rename from ext/spl/tests/bug44615.phpt
rename to ext/spl/tests/ArrayObject/bug44615.phpt
index 0b9aa82bc300b..3ac30192170c6 100644
--- a/ext/spl/tests/bug44615.phpt
+++ b/ext/spl/tests/ArrayObject/bug44615.phpt
@@ -20,7 +20,7 @@ foreach (new RecursiveIteratorIterator($rai) as $t) {
     var_dump($t);
 }
 ?>
---EXPECT--
+--EXPECTF--
 string(1) "z"
 object(stdClass)#1 (0) {
 }
@@ -28,5 +28,7 @@ string(1) "q"
 string(1) "s"
 Second:
 string(1) "z"
+
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 string(1) "q"
 string(1) "s"
diff --git a/ext/spl/tests/bug45614.phpt b/ext/spl/tests/ArrayObject/bug45614.phpt
similarity index 87%
rename from ext/spl/tests/bug45614.phpt
rename to ext/spl/tests/ArrayObject/bug45614.phpt
index 8c688555d3797..04c4638155359 100644
--- a/ext/spl/tests/bug45614.phpt
+++ b/ext/spl/tests/ArrayObject/bug45614.phpt
@@ -39,7 +39,8 @@ $ai->rewind();
 $ai->seek(0);
 showFirstTwoItems($ai);
 ?>
---EXPECT--
+--EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 --> Show the first two items:
 pub1 => public1
 pub2 => public2
diff --git a/ext/spl/tests/bug54323.phpt b/ext/spl/tests/ArrayObject/bug54323.phpt
similarity index 74%
rename from ext/spl/tests/bug54323.phpt
rename to ext/spl/tests/ArrayObject/bug54323.phpt
index 7431c9c47348a..fa1e64f4947c2 100644
--- a/ext/spl/tests/bug54323.phpt
+++ b/ext/spl/tests/ArrayObject/bug54323.phpt
@@ -18,6 +18,8 @@ function testAccess($c, $ao) {
 }
 ?>
 --EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+
 Warning: Undefined property: C::$prop in %s on line %d
 
 Warning: Undefined array key "prop" in %s on line %d
diff --git a/ext/spl/tests/bug62672.phpt b/ext/spl/tests/ArrayObject/bug62672.phpt
similarity index 71%
rename from ext/spl/tests/bug62672.phpt
rename to ext/spl/tests/ArrayObject/bug62672.phpt
index ec40ee695504b..2d70ca71a1bd4 100644
--- a/ext/spl/tests/bug62672.phpt
+++ b/ext/spl/tests/ArrayObject/bug62672.phpt
@@ -28,5 +28,6 @@ $obj = new ObjB(new ArrayObject());
 
 var_dump($obj == unserialize(serialize($obj)));
 ?>
---EXPECT--
+--EXPECTF--
+Deprecated: ArrayIterator::__unserialize(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 bool(true)
diff --git a/ext/spl/tests/ArrayObject/bug69845.phpt b/ext/spl/tests/ArrayObject/bug69845.phpt
new file mode 100644
index 0000000000000..6554e290e03a5
--- /dev/null
+++ b/ext/spl/tests/ArrayObject/bug69845.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Fixed bug #69845 (ArrayObject with ARRAY_AS_PROPS broken)
+--FILE--
+<?php
+for ($i = 0; $i<2; $i++) {
+    $data = new \ArrayObject(new stdClass(), ArrayObject::ARRAY_AS_PROPS);
+    $data->itemType = 'bulletin';
+    var_dump(!is_null($data['itemType']));
+}
+?>
+--EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+bool(true)
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+bool(true)
diff --git a/ext/spl/tests/bug70155.phpt b/ext/spl/tests/ArrayObject/bug70155.phpt
similarity index 75%
rename from ext/spl/tests/bug70155.phpt
rename to ext/spl/tests/ArrayObject/bug70155.phpt
index a609205aca279..27521015c4872 100644
--- a/ext/spl/tests/bug70155.phpt
+++ b/ext/spl/tests/ArrayObject/bug70155.phpt
@@ -9,6 +9,8 @@ $data = unserialize($exploit);
 var_dump($data);
 ?>
 --EXPECTF--
+Deprecated: ArrayObject::unserialize(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+
 Deprecated: Creation of dynamic property ArrayObject::$0 is deprecated in %s on line %d
 
 Fatal error: Uncaught InvalidArgumentException: Overloaded object of type DateInterval is not
compatible with ArrayObject in %s
diff --git a/ext/spl/tests/bug73209.phpt b/ext/spl/tests/ArrayObject/bug73209.phpt
similarity index 74%
rename from ext/spl/tests/bug73209.phpt
rename to ext/spl/tests/ArrayObject/bug73209.phpt
index 7383940936689..7da582b13523a 100644
--- a/ext/spl/tests/bug73209.phpt
+++ b/ext/spl/tests/ArrayObject/bug73209.phpt
@@ -19,7 +19,8 @@ foreach($iterator as $k=>$v) {
 }
 
 ?>
---EXPECT--
+--EXPECTF--
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 Expect to see all keys in ->props here: 
 props
 hello
diff --git a/ext/spl/tests/bug74669.phpt b/ext/spl/tests/ArrayObject/bug74669.phpt
similarity index 76%
rename from ext/spl/tests/bug74669.phpt
rename to ext/spl/tests/ArrayObject/bug74669.phpt
index 597e694296d26..17f622aaaf9d0 100644
--- a/ext/spl/tests/bug74669.phpt
+++ b/ext/spl/tests/ArrayObject/bug74669.phpt
@@ -93,13 +93,20 @@ var_dump($selfArray['foo']);
 
 ?>
 --EXPECTF--
+Deprecated: ArrayIterator::__unserialize(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 0 => test1
 1 => test2
+
+Deprecated: ArrayIterator::__unserialize(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 0 => test1
 1 => test2
 
+Deprecated: ArrayObject::unserialize(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
+
 Warning: Undefined array key "foo" in %s on line %d
 NULL
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 object(SelfArray)#9 (1) {
   ["foo"]=>
   string(3) "bar"
diff --git a/ext/spl/tests/gh10519.phpt b/ext/spl/tests/ArrayObject/gh10519.phpt
similarity index 88%
rename from ext/spl/tests/gh10519.phpt
rename to ext/spl/tests/ArrayObject/gh10519.phpt
index 1f7572d6e8ca6..5ef7fb3144f92 100644
--- a/ext/spl/tests/gh10519.phpt
+++ b/ext/spl/tests/ArrayObject/gh10519.phpt
@@ -62,7 +62,8 @@ $example->bugySetMethod(5, 'must be here');
 var_dump(json_encode($example));
 var_dump(json_encode($b));
 ?>
---EXPECT--
+--EXPECTF--
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 string(51)
"{"test":{"a":{"2":"","3":"","4":"","5":"in
here"}}}"
 string(51)
"{"test":{"a":{"2":"","3":"","4":"","5":"in
here"}}}"
 string(56)
"{"test":{"b":{"2":"","3":"","4":"","5":"must
be here"}}}"
diff --git a/ext/spl/tests/gh11178.phpt b/ext/spl/tests/ArrayObject/gh11178.phpt
similarity index 69%
rename from ext/spl/tests/gh11178.phpt
rename to ext/spl/tests/ArrayObject/gh11178.phpt
index 3732c57a59d19..91ac55d6f814a 100644
--- a/ext/spl/tests/gh11178.phpt
+++ b/ext/spl/tests/ArrayObject/gh11178.phpt
@@ -21,7 +21,8 @@ foreach ($obj as $k => &$v) {
 
 var_dump($obj);
 ?>
---EXPECT--
+--EXPECTF--
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 object(A)#1 (1) {
   ["x"]=>
   &int(3)
diff --git a/ext/spl/tests/gh15833_1.phpt b/ext/spl/tests/ArrayObject/gh15833_1.phpt
similarity index 71%
rename from ext/spl/tests/gh15833_1.phpt
rename to ext/spl/tests/ArrayObject/gh15833_1.phpt
index d658a770e80f5..5ee4b69e32560 100644
--- a/ext/spl/tests/gh15833_1.phpt
+++ b/ext/spl/tests/ArrayObject/gh15833_1.phpt
@@ -17,6 +17,7 @@ var_dump($recursiveArrayIterator->current());
 $recursiveArrayIterator->next();
 var_dump($recursiveArrayIterator->current());
 ?>
---EXPECT--
+--EXPECTF--
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 int(1)
 NULL
diff --git a/ext/spl/tests/gh15833_2.phpt b/ext/spl/tests/ArrayObject/gh15833_2.phpt
similarity index 81%
rename from ext/spl/tests/gh15833_2.phpt
rename to ext/spl/tests/ArrayObject/gh15833_2.phpt
index 8f30921741fe3..5d7721e25dd24 100644
--- a/ext/spl/tests/gh15833_2.phpt
+++ b/ext/spl/tests/ArrayObject/gh15833_2.phpt
@@ -34,7 +34,8 @@ try {
     echo $e->getMessage(), "\n";
 }
 ?>
---EXPECT--
+--EXPECTF--
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 nope 0
 nope 1
 nope 2
diff --git a/ext/spl/tests/gh15918.phpt b/ext/spl/tests/ArrayObject/gh15918.phpt
similarity index 61%
rename from ext/spl/tests/gh15918.phpt
rename to ext/spl/tests/ArrayObject/gh15918.phpt
index b26ff8adfc140..5efdb887f9b56 100644
--- a/ext/spl/tests/gh15918.phpt
+++ b/ext/spl/tests/ArrayObject/gh15918.phpt
@@ -9,5 +9,6 @@ try {
     echo $e->getMessage(), "\n";
 }
 ?>
---EXPECT--
+--EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 Overloaded object of type SplFixedArray is not compatible with ArrayObject
diff --git a/ext/spl/tests/gh16646.phpt b/ext/spl/tests/ArrayObject/gh16646.phpt
similarity index 71%
rename from ext/spl/tests/gh16646.phpt
rename to ext/spl/tests/ArrayObject/gh16646.phpt
index b6cb503d8ed05..f572346ea5dfa 100644
--- a/ext/spl/tests/gh16646.phpt
+++ b/ext/spl/tests/ArrayObject/gh16646.phpt
@@ -23,7 +23,8 @@ unset($arr["b"]);
 var_dump($arr);
 
 ?>
---EXPECT--
+--EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 C::__destruct
 object(ArrayObject)#1 (1) {
   ["storage":"ArrayObject":private]=>
diff --git a/ext/spl/tests/gh16646_2.phpt b/ext/spl/tests/ArrayObject/gh16646_2.phpt
similarity index 67%
rename from ext/spl/tests/gh16646_2.phpt
rename to ext/spl/tests/ArrayObject/gh16646_2.phpt
index d006583500811..035087fbe22bb 100644
--- a/ext/spl/tests/gh16646_2.phpt
+++ b/ext/spl/tests/ArrayObject/gh16646_2.phpt
@@ -16,7 +16,8 @@ $arr->exchangeArray([]);
 var_dump($arr);
 
 ?>
---EXPECT--
+--EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 C::__destruct
 object(ArrayObject)#1 (1) {
   ["storage":"ArrayObject":private]=>
diff --git a/ext/spl/tests/ArrayObject/property_hooks.phpt
b/ext/spl/tests/ArrayObject/property_hooks.phpt
index c0b2a372ebe4c..dfed649e7c630 100644
--- a/ext/spl/tests/ArrayObject/property_hooks.phpt
+++ b/ext/spl/tests/ArrayObject/property_hooks.phpt
@@ -63,6 +63,7 @@ var_dump($o->username);
 
 ?>
 --EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 Check object properties directly
 string(5) "FIRST"
 string(4) "last"
diff --git a/ext/spl/tests/arrayObject_getFlags_basic1.phpt
b/ext/spl/tests/arrayObject_getFlags_basic1.phpt
deleted file mode 100644
index 612a753680a38..0000000000000
--- a/ext/spl/tests/arrayObject_getFlags_basic1.phpt
+++ /dev/null
@@ -1,25 +0,0 @@
---TEST--
-SPL: ArrayObject::getFlags() basic usage
---FILE--
-<?php
-$ao = new ArrayObject(new ArrayObject(new stdClass));
-var_dump($ao->getFlags());
-
-$ao = new ArrayObject(new ArrayObject(array(1,2,3)), ArrayObject::STD_PROP_LIST);
-var_dump($ao->getFlags());
-
-$ao = new ArrayObject(new ArrayIterator(new ArrayObject()), ArrayObject::ARRAY_AS_PROPS);
-var_dump($ao->getFlags());
-
-$ao = new ArrayObject(new ArrayObject(), ArrayObject::STD_PROP_LIST|ArrayObject::ARRAY_AS_PROPS);
-var_dump($ao->getFlags());
-
-$cao = clone $ao;
-var_dump($cao->getFlags());
-?>
---EXPECT--
-int(0)
-int(1)
-int(2)
-int(3)
-int(3)
diff --git a/ext/spl/tests/arrayObject_getFlags_basic2.phpt
b/ext/spl/tests/arrayObject_getFlags_basic2.phpt
deleted file mode 100644
index db44322d674fa..0000000000000
--- a/ext/spl/tests/arrayObject_getFlags_basic2.phpt
+++ /dev/null
@@ -1,24 +0,0 @@
---TEST--
-SPL: ArrayObject::getFlags() - ensure flags are passed on to nested array objects and iterators.
---FILE--
-<?php
-$ao = new ArrayObject(array(), ArrayObject::STD_PROP_LIST|ArrayObject::ARRAY_AS_PROPS);
-var_dump($ao->getFlags());
-
-$ao2 = new ArrayObject($ao);
-var_dump($ao2->getFlags());
-var_dump($ao2->getIterator()->getFlags());
-
-$ai = new ArrayIterator($ao);
-var_dump($ai->getFlags());
-
-$ao2 = new ArrayObject($ao, 0);
-var_dump($ao2->getFlags());
-
-?>
---EXPECT--
-int(3)
-int(3)
-int(3)
-int(3)
-int(0)
diff --git a/ext/spl/tests/bug69845.phpt b/ext/spl/tests/bug69845.phpt
deleted file mode 100644
index 09c9f2356d44a..0000000000000
--- a/ext/spl/tests/bug69845.phpt
+++ /dev/null
@@ -1,13 +0,0 @@
---TEST--
-Fixed bug #69845 (ArrayObject with ARRAY_AS_PROPS broken)
---FILE--
-<?php
-for ($i = 0; $i<2; $i++) {
-    $data = new \ArrayObject(new stdClass(), ArrayObject::ARRAY_AS_PROPS);
-    $data->itemType = 'bulletin';
-    var_dump(!is_null($data['itemType']));
-}
-?>
---EXPECT--
-bool(true)
-bool(true)
diff --git a/ext/spl/tests/iterator_016.phpt b/ext/spl/tests/iterator_016.phpt
index abc81c165ae66..33ee78064201c 100644
--- a/ext/spl/tests/iterator_016.phpt
+++ b/ext/spl/tests/iterator_016.phpt
@@ -8,7 +8,7 @@ class Menu extends ArrayObject
     function getIterator(): RecursiveArrayIterator
     {
         echo __METHOD__ . "\n";
-        return new RecursiveArrayIterator($this);
+        return new RecursiveArrayIterator($this->getArrayCopy());
     }
 }
 
@@ -42,7 +42,18 @@ class MenuOutput extends RecursiveIteratorIterator
     }
 }
 
-$arr = array("a", array("ba", array("bba", "bbb"),
array(array("bcaa"))), array("ca"), "d");
+$arr = [
+    "a",
+    [
+        "ba",
+        ["bba", "bbb"],
+        [
+            ["bcaa"]
+        ]
+    ],
+    ["ca"],
+    "d",
+];
 $obj = new Menu($arr);
 $rit = new MenuOutput($obj);
 foreach($rit as $k=>$v)
diff --git a/ext/spl/tests/iterator_069.phpt b/ext/spl/tests/iterator_069.phpt
index b9ee3f4b820d9..e30251fa9162f 100644
--- a/ext/spl/tests/iterator_069.phpt
+++ b/ext/spl/tests/iterator_069.phpt
@@ -3,10 +3,10 @@ SPL: RecursiveIteratorIterator cannot be used with foreach by reference
 --FILE--
 <?php
 
-$arr = array(array(1,2));
-$arrOb = new ArrayObject($arr);
-
-$recArrIt = new RecursiveArrayIterator($arrOb->getIterator());
+$recArrIt = new RecursiveArrayIterator([
+    [1, 2],
+    ['a', 'b'],
+]);
 
 $recItIt = new RecursiveIteratorIterator($recArrIt);
 
diff --git a/ext/spl/tests/iterator_071.phpt b/ext/spl/tests/iterator_071.phpt
index 7f525eb2c61d6..4f9b18d0c0748 100644
--- a/ext/spl/tests/iterator_071.phpt
+++ b/ext/spl/tests/iterator_071.phpt
@@ -3,10 +3,10 @@ SPL: RecursiveIteratorIterator - Test where the case is RS_SELF and mode is CHIL
 --FILE--
 <?php
 
-$arr = array(array(1,2),2);
-$arrOb = new ArrayObject($arr);
-
-$recArrIt = new RecursiveArrayIterator($arrOb->getIterator());
+$recArrIt = new RecursiveArrayIterator([
+    [1, 2],
+    ['a', 'b'],
+]);
 
 class MyRecursiveIteratorIterator extends RecursiveIteratorIterator {
 
@@ -29,4 +29,8 @@ MyRecursiveIteratorIterator::nextelement
 MyRecursiveIteratorIterator::nextelement
 0
 MyRecursiveIteratorIterator::nextelement
+0
+MyRecursiveIteratorIterator::nextelement
+1
+MyRecursiveIteratorIterator::nextelement
 1
diff --git a/ext/spl/tests/recursiveIteratorIterator_beginchildren_error.phpt
b/ext/spl/tests/recursiveIteratorIterator_beginchildren_error.phpt
index 6a7d3eb8a514c..76bacc3615f7d 100644
--- a/ext/spl/tests/recursiveIteratorIterator_beginchildren_error.phpt
+++ b/ext/spl/tests/recursiveIteratorIterator_beginchildren_error.phpt
@@ -3,10 +3,10 @@ SPL: RecursiveIteratorIterator - Exception thrown in beginchildren which should
 --FILE--
 <?php
 
-$arr = array(array(1,2),2);
-$arrOb = new ArrayObject($arr);
-
-$recArrIt = new RecursiveArrayIterator($arrOb->getIterator());
+$recArrIt = new RecursiveArrayIterator([
+    [1, 2],
+    ['a', 'b'],
+]);
 
 class MyRecursiveIteratorIterator extends RecursiveIteratorIterator {
 
diff --git a/ext/spl/tests/recursiveIteratorIterator_callHasChildren_error.phpt
b/ext/spl/tests/recursiveIteratorIterator_callHasChildren_error.phpt
index 1c96ee9fcd0bf..9256e9e3b1b27 100644
--- a/ext/spl/tests/recursiveIteratorIterator_callHasChildren_error.phpt
+++ b/ext/spl/tests/recursiveIteratorIterator_callHasChildren_error.phpt
@@ -3,10 +3,10 @@ SPL: RecursiveIteratorIterator - Exception thrown in callHasChildren which shoul
 --FILE--
 <?php
 
-$arr = array(1,2);
-$arrOb = new ArrayObject($arr);
-
-$recArrIt = new RecursiveArrayIterator($arrOb->getIterator());
+$recArrIt = new RecursiveArrayIterator([
+    [1, 2],
+    ['a', 'b'],
+]);
 
 class MyRecursiveIteratorIterator extends RecursiveIteratorIterator {
 
diff --git a/ext/spl/tests/recursiveIteratorIterator_endchildren_error.phpt
b/ext/spl/tests/recursiveIteratorIterator_endchildren_error.phpt
index 13af7ce01986d..07dee9c4acbbc 100644
--- a/ext/spl/tests/recursiveIteratorIterator_endchildren_error.phpt
+++ b/ext/spl/tests/recursiveIteratorIterator_endchildren_error.phpt
@@ -3,10 +3,10 @@ SPL: RecursiveIteratorIterator - Exception thrown in endchildren which should be
 --FILE--
 <?php
 
-$arr = array(array(1,2));
-$arrOb = new ArrayObject($arr);
-
-$recArrIt = new RecursiveArrayIterator($arrOb->getIterator());
+$recArrIt = new RecursiveArrayIterator([
+    [1, 2],
+    ['a', 'b'],
+]);
 
 class MyRecursiveIteratorIterator extends RecursiveIteratorIterator {
 
@@ -30,6 +30,8 @@ foreach ($recItIt2 as $val) echo "$val\n";
 --EXPECTF--
 1
 2
+a
+b
 ===NEXT LOOP===
 1
 2
diff --git a/ext/spl/tests/recursiveIteratorIterator_nextelement_error.phpt
b/ext/spl/tests/recursiveIteratorIterator_nextelement_error.phpt
index d92d309c754ba..f89f47e849b25 100644
--- a/ext/spl/tests/recursiveIteratorIterator_nextelement_error.phpt
+++ b/ext/spl/tests/recursiveIteratorIterator_nextelement_error.phpt
@@ -3,10 +3,10 @@ SPL: RecursiveIteratorIterator - Exception thrown in nextelement which should be
 --FILE--
 <?php
 
-$arr = array(1,2);
-$arrOb = new ArrayObject($arr);
-
-$recArrIt = new RecursiveArrayIterator($arrOb->getIterator());
+$recArrIt = new RecursiveArrayIterator([
+    [1, 2],
+    ['a', 'b'],
+]);
 
 class MyRecursiveIteratorIterator extends RecursiveIteratorIterator {
 
diff --git a/ext/spl/tests/recursive_tree_iterator_007.phpt
b/ext/spl/tests/recursive_tree_iterator_007.phpt
index 2907f39f26575..75f1e6386c8ee 100644
--- a/ext/spl/tests/recursive_tree_iterator_007.phpt
+++ b/ext/spl/tests/recursive_tree_iterator_007.phpt
@@ -1,15 +1,16 @@
 --TEST--
 SPL: RecursiveTreeIterator and Exception from getEntry()
---INI--
-error_reporting=E_ALL&~E_NOTICE
 --FILE--
 <?php
 
-$ary = array(new stdClass);
+$ary = [
+    ['string'],
+    [new stdClass],
+];
 
 class RecursiveArrayIteratorAggregated implements IteratorAggregate {
-    public $it;
-    function __construct($it) {
+    public RecursiveArrayIterator $it;
+    function __construct(array $it) {
         $this->it = new RecursiveArrayIterator($it);
     }
     function getIterator(): Traversable {
@@ -27,5 +28,10 @@ try {
 }
 
 ?>
---EXPECT--
+--EXPECTF--
+[0] => |-Array
+[0] => | \-string
+[1] => \-Array
+
+Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 Object of class stdClass could not be converted to string
diff --git a/ext/standard/tests/class_object/get_object_vars_variation_005.phpt
b/ext/standard/tests/class_object/get_object_vars_variation_005.phpt
index 1ad1bb3933293..2fed6468c5304 100644
--- a/ext/standard/tests/class_object/get_object_vars_variation_005.phpt
+++ b/ext/standard/tests/class_object/get_object_vars_variation_005.phpt
@@ -25,6 +25,7 @@ var_dump(get_object_vars($obj));
 
 ?>
 --EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 array(3) {
   ["%0A%0b"]=>
   int(42)
@@ -33,6 +34,8 @@ array(3) {
   [12]=>
   int(6)
 }
+
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 array(4) {
   ["prop"]=>
   NULL
diff --git
a/ext/standard/tests/directory/DirectoryClass_readonly_handle_by_pass_via_ArrayObject.phpt
b/ext/standard/tests/directory/DirectoryClass_readonly_handle_by_pass_via_ArrayObject.phpt
index 91416f2c71202..5af789ff424a5 100644
--- a/ext/standard/tests/directory/DirectoryClass_readonly_handle_by_pass_via_ArrayObject.phpt
+++ b/ext/standard/tests/directory/DirectoryClass_readonly_handle_by_pass_via_ArrayObject.phpt
@@ -28,7 +28,8 @@ try {
 }
 
 ?>
---EXPECT--
+--EXPECTF--
+Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is
deprecated, as it allows violating class constraints and invariants in %s on line %d
 resource(3) of type (stream)
 Error: Internal directory stream has been altered
 Error: Typed property Directory::$handle must not be accessed before initialization


Thread (1 message)

  • Gina Peter Banyard via GitHub
« previous php.cvs (#135286) next »