diff options
Diffstat (limited to 'ext/standard/tests/strings/bug61038.phpt')
-rw-r--r-- | ext/standard/tests/strings/bug61038.phpt | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/ext/standard/tests/strings/bug61038.phpt b/ext/standard/tests/strings/bug61038.phpt new file mode 100644 index 0000000000..7130804fa4 --- /dev/null +++ b/ext/standard/tests/strings/bug61038.phpt @@ -0,0 +1,26 @@ +--TEST-- +Bug #61038: unpack("a5", "str\0\0") does not work as expected +--FILE-- +<?php +var_dump(unpack("a4", "str\0\0")); +var_dump(unpack("a5", "str\0\0")); +var_dump(unpack("a6", "str\0\0")); +var_dump(unpack("a*", "str\0\0")); +?> +--EXPECTF-- +array(1) { + [1]=> + string(4) "str%c" +} +array(1) { + [1]=> + string(5) "str%c%c" +} + +Warning: unpack(): Type a: not enough input, need 6, have 5 in %s on line %d +bool(false) +array(1) { + [1]=> + string(5) "str%c%c" +} + |