@@ -4,60 +4,16 @@ Check for hashids presence
44<?php if (!extension_loaded ("hashids " )) print "skip " ; ?>
55--FILE--
66<?php
7-
8- $ hashids = new Hashids ();
9-
10- $ hash = $ hashids ->encode (1 , 2 , 3 , 4 , 5 ); // ADf9h9i0sQ
11- $ numbers = $ hashids ->decode ($ hash ); // [1, 2, 3, 4, 5]
12-
13- echo $ hash . "\n" ;
14- print_r ($ numbers );
15-
16- //or would you prefer to use a static method call
17- $ hash = Hashids::encode (1 , 2 , 3 , 4 , 5 ); // ADf9h9i0sQ
18- $ numbers = Hashids::decode ($ hash ); // [1, 2, 3, 4, 5]
19-
20- echo $ hash . "\n" ;
21- print_r ($ numbers );
22-
23- //decode
24- $ numbers = $ hashids ->decode ("ADf9h9i0sQ " );
25- print_r ($ numbers );
26-
27- //encodeHex
28- $ hash = $ hashids ->encodeHex ('FFFFDD ' ); // rYKPAK
29- $ hex = $ hashids ->decodeHex ('rYKPAK ' ); // FFFFDD
30-
31- echo $ hash . "\n" ;
32- echo $ hex ;
33-
7+ echo "hashids extension is available " ;
8+ /*
9+ you can add regression tests for your extension here
10+ the output of your test code has to be equal to the
11+ text in the --EXPECT-- section below for the tests
12+ to pass, differences between the output and the
13+ expected text are interpreted as failure
14+ see php5/README.TESTING for further information on
15+ writing regression tests
16+ */
3417?>
3518--EXPECT--
36- ADf9h9i0sQ
37- Array
38- (
39- [0] => 1
40- [1] => 2
41- [2] => 3
42- [3] => 4
43- [4] => 5
44- )
45- ADf9h9i0sQ
46- Array
47- (
48- [0] => 1
49- [1] => 2
50- [2] => 3
51- [3] => 4
52- [4] => 5
53- )
54- Array
55- (
56- [0] => 1
57- [1] => 2
58- [2] => 3
59- [3] => 4
60- [4] => 5
61- )
62- rYKPAK
63- FFFFDD
19+ hashids extension is available
0 commit comments