summaryrefslogtreecommitdiff
path: root/ext/standard/tests/strings/unpack_bug68225.phpt
blob: b02b0383bf3f3c068cc5584ebe7bc2a8cab049c8 (plain)
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
--TEST--
Bug #68225 unpack and X format code
--FILE--
<?php

$data = pack('VV', 1, 2);

$result = unpack('Va/X' ,$data);
var_dump($result);

$result = unpack('Va/X4' ,$data);
var_dump($result);

$result = unpack('V1a/X4/V1b/V1c/X4/V1d', $data);
var_dump($result);

?>
===DONE===
--EXPECT--
array(1) {
  ["a"]=>
  int(1)
}
array(1) {
  ["a"]=>
  int(1)
}
array(4) {
  ["a"]=>
  int(1)
  ["b"]=>
  int(1)
  ["c"]=>
  int(2)
  ["d"]=>
  int(2)
}
===DONE===