Switch to * instead of + in zpp.
- Standard:
. Implemented the RFC `Random Functions Throwing Exceptions in PHP 7`.
(Sammy Kaye Powers, Anthony)
+ . Fixed bug #70487 (pack('x') produces an error). (Nikita)
- Streams:
. Fixed bug #70361 (HTTP stream wrapper doesn't close keep-alive connections).
PHP_FUNCTION(pack)
{
zval *argv = NULL;
- int num_args, i;
+ int num_args = 0, i;
int currentarg;
char *format;
size_t formatlen;
int outputpos = 0, outputsize = 0;
zend_string *output;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s+", &format, &formatlen, &argv, &num_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s*", &format, &formatlen, &argv, &num_args) == FAILURE) {
return;
}
--- /dev/null
+--TEST--
+Bug #70487: pack('x') produces an error
+--FILE--
+<?php
+
+var_dump(pack('x') === "\0");
+
+?>
+--EXPECT--
+bool(true)