Skip to content

Commit 6ca7646

Browse files
Implement __serialize() in addition to __sleep() (which will be deprecated in PHP 8.5)
1 parent 0bab61c commit 6ca7646

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

ChangeLog-8.5.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes of the PHPUnit 8.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
44

5+
## [8.5.45] - 2025-MM-DD
6+
7+
### Changed
8+
9+
* Implement `__serialize()` in addition to `__sleep()` (which will be deprecated in PHP 8.5)
10+
511
## [8.5.44] - 2025-08-20
612

713
### Changed
@@ -340,6 +346,7 @@ All notable changes of the PHPUnit 8.5 release series are documented in this fil
340346
* [#3967](https://github.com/sebastianbergmann/phpunit/issues/3967): Cannot double interface that extends interface that extends `\Throwable`
341347
* [#3968](https://github.com/sebastianbergmann/phpunit/pull/3968): Test class run in a separate PHP process are passing when `exit` called inside
342348

349+
[8.5.45]: https://github.com/sebastianbergmann/phpunit/compare/8.5.44...8.5
343350
[8.5.44]: https://github.com/sebastianbergmann/phpunit/compare/8.5.43...8.5.44
344351
[8.5.43]: https://github.com/sebastianbergmann/phpunit/compare/8.5.42...8.5.43
345352
[8.5.42]: https://github.com/sebastianbergmann/phpunit/compare/8.5.41...8.5.42

src/Framework/Exception/Exception.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ public function __sleep(): array
7171
return array_keys(get_object_vars($this));
7272
}
7373

74+
public function __serialize(): array
75+
{
76+
return get_object_vars($this);
77+
}
78+
7479
/**
7580
* Returns the serializable trace (without 'args').
7681
*/

0 commit comments

Comments
 (0)