summaryrefslogtreecommitdiff
path: root/ext/spl/tests/arrayObject_exchangeArray_basic3.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/spl/tests/arrayObject_exchangeArray_basic3.phpt')
-rw-r--r--ext/spl/tests/arrayObject_exchangeArray_basic3.phpt14
1 files changed, 6 insertions, 8 deletions
diff --git a/ext/spl/tests/arrayObject_exchangeArray_basic3.phpt b/ext/spl/tests/arrayObject_exchangeArray_basic3.phpt
index 823256edbc..68f20f7bb6 100644
--- a/ext/spl/tests/arrayObject_exchangeArray_basic3.phpt
+++ b/ext/spl/tests/arrayObject_exchangeArray_basic3.phpt
@@ -29,8 +29,8 @@ $ao = new ArrayObject($original);
try {
$copy = $ao->exchangeArray();
$copy['addedToCopy'] = 'added To Copy';
-} catch (Exception $e) {
- echo "Exception:" . $e->getMessage() . "\n";
+} catch (TypeError $e) {
+ echo "Exception: " . $e->getMessage() . "\n";
}
$original->addedToOriginal = 'added To Original';
var_dump($ao, $original, $copy);
@@ -81,8 +81,9 @@ array(2) {
--> exchangeArray() with no arg:
+Exception: ArrayObject::exchangeArray() expects exactly 1 parameter, 0 given
-Warning: ArrayObject::exchangeArray() expects exactly 1 parameter, 0 given in %s on line 27
+Warning: Undefined variable: copy in %s on line %d
object(ArrayObject)#2 (1) {
["storage":"ArrayObject":private]=>
object(C)#3 (2) {
@@ -98,16 +99,13 @@ object(C)#3 (2) {
["addedToOriginal"]=>
string(17) "added To Original"
}
-array(1) {
- ["addedToCopy"]=>
- string(13) "added To Copy"
-}
+NULL
--> exchangeArray() with bad arg type:
Exception:Passed variable is not an array or object
-Notice: Undefined variable: copy in %s on line 46
+Warning: Undefined variable: copy in %s on line %d
object(ArrayObject)#3 (1) {
["storage":"ArrayObject":private]=>
object(C)#2 (2) {