We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dee1b2f commit 68f7bc5Copy full SHA for 68f7bc5
src/functions.php
@@ -7,7 +7,9 @@
7
8
function ensureValidDocument($document) {
9
if ($document instanceof Serializable) {
10
- $document = $document->bsonSerialize();
+ // do not validate Serializable instances since call to Serializable::bsonSerialize()
11
+ // will increase a memory usage by creating array|object copy of the document
12
+ return;
13
}
14
15
$arrayDocument = (array) $document;
@@ -21,11 +23,6 @@ function ensureValidDocument($document) {
21
23
)
22
24
);
25
-
- // Check nested document, if it's not a circular reference to the current $document
26
- if ((is_array($value) || is_object($value)) && !$value === $document) {
27
- ensureValidDocument($value);
28
- }
29
30
31
0 commit comments