Skip to content

Commit

Permalink
Add test for issue #94 ((PHP7 segmentation fault with references))
Browse files Browse the repository at this point in the history
  • Loading branch information
Marlies Heijkoop authored and Sean-Der committed Dec 7, 2016
1 parent cb3a2d5 commit 5c9870c
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions tests/issue094.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
--TEST--
Issue #94 (PHP7 segmentation fault with references)
--SKIPIF--
<?php
if (!extension_loaded("msgpack")) {
echo "skip";
}
--FILE--
<?php
$bad = unserialize('a:4:{i:1;a:1:{s:10:"verylongid";s:1:"1";}i:10;a:1:{s:10:"verylongid";s:2:"10";}i:16;a:1:{s:10:"verylongid";s:2:"16";}i:0;a:1:{s:8:"children";a:3:{i:16;R:6;i:10;R:4;i:1;R:2;}}}');
$p = msgpack_pack($bad);
print_r(msgpack_unpack($p));
--EXPECT--
Array
(
[1] => Array
(
[verylongid] => 1
)

[10] => Array
(
[verylongid] => 10
)

[16] => Array
(
[verylongid] => 16
)

[0] => Array
(
[children] => Array
(
[16] => Array
(
[verylongid] => 16
)

[10] => Array
(
[verylongid] => 10
)

[1] => Array
(
[verylongid] => 1
)

)

)

)

0 comments on commit 5c9870c

Please sign in to comment.