hiphop-php /hphp/test/zend/bad/ext/standard/tests/strings/pack.php

Language PHP Lines 90
MD5 Hash bff02526a7e6ccedfe4087d38755caa9 Estimated Cost $1,730 (why?)
Repository git://github.com/facebook/hiphop-php.git View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
print_r(unpack("A", pack("A", "hello world")));
print_r(unpack("A*", pack("A*", "hello world")));
echo '"'.pack("A9", "hello").'"';
echo "\n";

print_r(unpack("C", pack("C", -127)));
print_r(unpack("C", pack("C", 127)));
print_r(unpack("C", pack("C", 255)));
print_r(unpack("C", pack("C", -129)));

print_r(unpack("H", pack("H", 0x04)));

print_r(unpack("I", pack("I", 65534)));
print_r(unpack("I", pack("I", 0)));
print_r(unpack("I", pack("I", -1000)));
print_r(unpack("I", pack("I", -64434)));
print_r(unpack("I", pack("I", 4294967296)));
print_r(unpack("I", pack("I", -4294967296)));

print_r(unpack("L", pack("L", 65534)));
print_r(unpack("L", pack("L", 0)));
print_r(unpack("L", pack("L", 2147483650)));
print_r(unpack("L", pack("L", 4294967295)));
print_r(unpack("L", pack("L", -2147483648)));

print_r(unpack("N", pack("N", 65534)));
print_r(unpack("N", pack("N", 0)));
print_r(unpack("N", pack("N", 2147483650)));
print_r(unpack("N", pack("N", 4294967296)));
print_r(unpack("N", pack("N", -2147483648)));
print_r(unpack("N", pack("N", -30000)));

print_r(unpack("S", pack("S", 65534)));
print_r(unpack("S", pack("S", 65537)));
print_r(unpack("S", pack("S", 0)));
print_r(unpack("S", pack("S", -1000)));
print_r(unpack("S", pack("S", -64434)));
print_r(unpack("S", pack("S", -65535)));

print_r(unpack("V", pack("V", 65534)));
print_r(unpack("V", pack("V", 0)));
print_r(unpack("V", pack("V", 2147483650)));
print_r(unpack("V", pack("V", 4294967296)));
print_r(unpack("V", pack("V", -2147483648)));

print_r(unpack("a", pack("a", "hello world")));
print_r(unpack("a*", pack("a*", "hello world")));

print_r(unpack("c", pack("c", -127)));
print_r(unpack("c", pack("c", 127)));
print_r(unpack("c", pack("c", 255)));
print_r(unpack("c", pack("c", -129)));

print_r(unpack("h", pack("h", 3000000)));

print_r(unpack("i", pack("i", 65534)));
print_r(unpack("i", pack("i", 0)));
print_r(unpack("i", pack("i", -1000)));
print_r(unpack("i", pack("i", -64434)));
print_r(unpack("i", pack("i", -65535)));
print_r(unpack("i", pack("i", -2147483647)));

print_r(unpack("l", pack("l", 65534)));
print_r(unpack("l", pack("l", 0)));
print_r(unpack("l", pack("l", 2147483650)));
print_r(unpack("l", pack("l", 4294967296)));
print_r(unpack("l", pack("l", -2147483648)));

print_r(unpack("n", pack("n", 65534)));
print_r(unpack("n", pack("n", 65537)));
print_r(unpack("n", pack("n", 0)));
print_r(unpack("n", pack("n", -1000)));
print_r(unpack("n", pack("n", -64434)));
print_r(unpack("n", pack("n", -65535)));

print_r(unpack("s", pack("s", 32767)));
print_r(unpack("s", pack("s", 65535)));
print_r(unpack("s", pack("s", 0)));
print_r(unpack("s", pack("s", -1000)));
print_r(unpack("s", pack("s", -64434)));
print_r(unpack("s", pack("s", -65535)));

print_r(unpack("v", pack("v", 65534)));
print_r(unpack("v", pack("v", 65537)));
print_r(unpack("v", pack("v", 0)));
print_r(unpack("v", pack("v", -1000)));
print_r(unpack("v", pack("v", -64434)));
print_r(unpack("v", pack("v", -65535)));
?>
Back to Top