xref: /PHP-8.3/ext/standard/tests/strings/pack_A.phpt (revision f8d79582)
1--TEST--
2pack()/unpack(): "A" modifier
3--FILE--
4<?php
5var_dump(
6    pack("A5", "foo "),
7    pack("A4", "fooo"),
8    pack("A4", "foo"),
9    unpack("A*", "foo\0\rbar\0 \t\r\n"),
10    unpack("A4", "foo\0\rbar\0 \t\r\n")
11);
12?>
13--EXPECTF--
14string(5) "foo  "
15string(4) "fooo"
16string(4) "foo "
17array(1) {
18  [1]=>
19  string(8) "foo%c%cbar"
20}
21array(1) {
22  [1]=>
23  string(3) "foo"
24}
25