mirror of
https://github.com/php/php-src.git
synced 2024-12-18 06:21:41 +08:00
parent
669f0b39b1
commit
ab74d80247
1
NEWS
1
NEWS
@ -41,6 +41,7 @@ PHP NEWS
|
||||
- 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).
|
||||
|
@ -112,7 +112,7 @@ static void php_pack(zval *val, size_t size, int *map, char *output)
|
||||
PHP_FUNCTION(pack)
|
||||
{
|
||||
zval *argv = NULL;
|
||||
int num_args, i;
|
||||
int num_args = 0, i;
|
||||
int currentarg;
|
||||
char *format;
|
||||
size_t formatlen;
|
||||
@ -122,7 +122,7 @@ PHP_FUNCTION(pack)
|
||||
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;
|
||||
}
|
||||
|
||||
|
10
ext/standard/tests/strings/bug70487.phpt
Normal file
10
ext/standard/tests/strings/bug70487.phpt
Normal file
@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Bug #70487: pack('x') produces an error
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(pack('x') === "\0");
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
Loading…
Reference in New Issue
Block a user