-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: 0.5.1
-
Component/s: None
The following test begins to segfault around 12750 iterations:
--TEST-- Test for PHPC-276: BSON\Serializable recursion --SKIPIF-- <?php require __DIR__ . "/../utils/basic-skipif.inc"?> --FILE-- <?php require_once __DIR__ . "/../utils/basic.inc"; class MyClass implements BSON\Serializable { private $recursion; public function __construct($recursion) { $this->recursion = $recursion; } public function bsonSerialize() { return ($this->recursion >= 1) ? array(new self($this->recursion - 1)) : array('end'); } } $bson = BSON\fromArray(new MyClass(12750)); echo BSON\toJSON($bson), "\n"; echo "Encoded BSON:\n"; hex_dump($bson); ?> ===DONE=== <?php exit(0); ?> --EXPECT-- ... ===DONE===
- is related to
-
CDRIVER-634 Allow setting max recursion depth at runtime
- Closed