1--TEST--
2Lengths and references are not signed
3--FILE--
4<?php
5
6var_dump(unserialize('s:+1:"x";'));
7var_dump(unserialize('s:-1:"x";'));
8var_dump(unserialize('a:+0:{}'));
9var_dump(unserialize('a:-0:{}'));
10var_dump(unserialize('O:+8:"stdClass":0:{}'));
11var_dump(unserialize('O:-8:"stdClass":0:{}'));
12var_dump(unserialize('C:+11:"ArrayObject":0:{}'));
13var_dump(unserialize('C:-11:"ArrayObject":0:{}'));
14var_dump(unserialize('a:1:{i:0;r:+1;}'));
15var_dump(unserialize('a:1:{i:0;r:-1;}'));
16var_dump(unserialize('a:1:{i:0;R:+1;}'));
17var_dump(unserialize('a:1:{i:0;R:-1;}'));
18
19?>
20--EXPECTF--
21Notice: unserialize(): Error at offset 0 of 9 bytes in %s on line %d
22bool(false)
23
24Notice: unserialize(): Error at offset 0 of 9 bytes in %s on line %d
25bool(false)
26
27Notice: unserialize(): Error at offset 0 of 7 bytes in %s on line %d
28bool(false)
29
30Notice: unserialize(): Error at offset 0 of 7 bytes in %s on line %d
31bool(false)
32
33Notice: unserialize(): Error at offset 0 of 20 bytes in %s on line %d
34bool(false)
35
36Notice: unserialize(): Error at offset 0 of 20 bytes in %s on line %d
37bool(false)
38
39Notice: unserialize(): Error at offset 0 of 24 bytes in %s on line %d
40bool(false)
41
42Notice: unserialize(): Error at offset 0 of 24 bytes in %s on line %d
43bool(false)
44
45Notice: unserialize(): Error at offset 9 of 15 bytes in %s on line %d
46bool(false)
47
48Notice: unserialize(): Error at offset 9 of 15 bytes in %s on line %d
49bool(false)
50
51Notice: unserialize(): Error at offset 9 of 15 bytes in %s on line %d
52bool(false)
53
54Notice: unserialize(): Error at offset 9 of 15 bytes in %s on line %d
55bool(false)
56