-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed bug #12 (msgpack_seriallize interfere with php serialize)
- Loading branch information
Showing
4 changed files
with
113 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--TEST-- | ||
Bug #12 (msgpack_seriallize interfere with php serialize) | ||
--SKIPIF-- | ||
<?php | ||
if (!extension_loaded("msgpack")) { | ||
echo "skip"; | ||
} | ||
if (version_compare(PHP_VERSION, '5.4.0') < 0) { | ||
echo "skip tests before PHP 5.4"; | ||
} | ||
--FILE-- | ||
<?php | ||
|
||
class Demo extends ArrayObject { | ||
|
||
} | ||
|
||
$obj = new StdClass(); | ||
|
||
$demo = new Demo; | ||
|
||
$demo[] = $obj; | ||
$demo[] = $obj; | ||
|
||
$data = array( | ||
$demo, | ||
$obj, | ||
$obj, | ||
); | ||
|
||
print_r(msgpack_unserialize(msgpack_serialize($data))); | ||
?> | ||
--EXPECTF-- | ||
Array | ||
( | ||
[0] => Demo Object | ||
( | ||
[storage:ArrayObject:private] => Array | ||
( | ||
[0] => stdClass Object | ||
( | ||
) | ||
|
||
[1] => stdClass Object | ||
( | ||
) | ||
|
||
) | ||
|
||
) | ||
|
||
[1] => stdClass Object | ||
( | ||
) | ||
|
||
[2] => stdClass Object | ||
( | ||
) | ||
|
||
) |