Skip to content

Commit 5c9870c

Browse files
mheijkoopSean-Der
authored andcommitted
Add test for issue #94 ((PHP7 segmentation fault with references))
1 parent cb3a2d5 commit 5c9870c

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

tests/issue094.phpt

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
--TEST--
2+
Issue #94 (PHP7 segmentation fault with references)
3+
--SKIPIF--
4+
<?php
5+
if (!extension_loaded("msgpack")) {
6+
echo "skip";
7+
}
8+
--FILE--
9+
<?php
10+
$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;}}}');
11+
$p = msgpack_pack($bad);
12+
print_r(msgpack_unpack($p));
13+
--EXPECT--
14+
Array
15+
(
16+
[1] => Array
17+
(
18+
[verylongid] => 1
19+
)
20+
21+
[10] => Array
22+
(
23+
[verylongid] => 10
24+
)
25+
26+
[16] => Array
27+
(
28+
[verylongid] => 16
29+
)
30+
31+
[0] => Array
32+
(
33+
[children] => Array
34+
(
35+
[16] => Array
36+
(
37+
[verylongid] => 16
38+
)
39+
40+
[10] => Array
41+
(
42+
[verylongid] => 10
43+
)
44+
45+
[1] => Array
46+
(
47+
[verylongid] => 1
48+
)
49+
50+
)
51+
52+
)
53+
54+
)

0 commit comments

Comments
 (0)