We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents bb00ddd + 9a77a40 commit 70bfc45Copy full SHA for 70bfc45
ext/standard/pack.c
@@ -275,6 +275,7 @@ PHP_FUNCTION(pack)
275
276
case 'a':
277
case 'A':
278
+ case 'Z':
279
case 'c':
280
case 'C':
281
case 'x':
@@ -349,7 +350,9 @@ PHP_FUNCTION(pack)
349
350
switch ((int) code) {
351
352
- memset(&output[outputpos], (code == 'a') ? '\0' : ' ', arg);
353
+ case 'Z': {
354
+ int arg_cp = (code != 'Z') ? arg : MAX(0, arg - 1);
355
+ memset(&output[outputpos], (code == 'a' || code == 'Z') ? '\0' : ' ', arg);
356
val = argv[currentarg++];
357
if (Z_ISREF_PP(val)) {
358
SEPARATE_ZVAL(val);
0 commit comments