|
16 | 16 | $copy = $ao->exchangeArray($swapIn); |
17 | 17 | $copy['addedToCopy'] = 'added To Copy'; |
18 | 18 | } catch (Exception $e) { |
19 | | - echo "Exception:" . $e->getMessage() . "\n"; |
| 19 | + echo $e::class, ': ', $e->getMessage(), "\n"; |
20 | 20 | } |
21 | 21 | $swapIn->addedToSwapIn = 'added To Swap-In'; |
22 | 22 | $original->addedToOriginal = 'added To Original'; |
|
31 | 31 | $copy = $ao->exchangeArray(); |
32 | 32 | $copy['addedToCopy'] = 'added To Copy'; |
33 | 33 | } catch (TypeError $e) { |
34 | | - echo "Exception: " . $e->getMessage() . "\n"; |
| 34 | + echo $e::class, ': ', $e->getMessage(), "\n"; |
35 | 35 | } |
36 | 36 | $original->addedToOriginal = 'added To Original'; |
37 | 37 | var_dump($ao, $original, $copy); |
|
44 | 44 | $copy = $ao->exchangeArray(null); |
45 | 45 | $copy['addedToCopy'] = 'added To Copy'; |
46 | 46 | } catch (TypeError $e) { |
47 | | - echo $e->getMessage() . "\n"; |
| 47 | + echo $e::class, ': ', $e->getMessage(), "\n"; |
48 | 48 | } |
49 | 49 | $original->addedToOriginal = 'added To Original'; |
50 | 50 | var_dump($ao, $original, $copy); |
@@ -92,7 +92,7 @@ array(2) { |
92 | 92 | --> exchangeArray() with no arg: |
93 | 93 |
|
94 | 94 | 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 |
95 | | -Exception: ArrayObject::exchangeArray() expects exactly 1 argument, 0 given |
| 95 | +ArgumentCountError: ArrayObject::exchangeArray() expects exactly 1 argument, 0 given |
96 | 96 |
|
97 | 97 | Deprecated: Creation of dynamic property C::$addedToOriginal is deprecated in %s on line %d |
98 | 98 |
|
|
118 | 118 | --> exchangeArray() with bad arg type: |
119 | 119 |
|
120 | 120 | 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 |
121 | | -ArrayObject::exchangeArray(): Argument #1 ($array) must be of type array, null given |
| 121 | +TypeError: ArrayObject::exchangeArray(): Argument #1 ($array) must be of type array, null given |
122 | 122 |
|
123 | 123 | Deprecated: Creation of dynamic property C::$addedToOriginal is deprecated in %s on line %d |
124 | 124 |
|
|
0 commit comments