Merge branch 'PHP-7.0' into PHP-7.1

This commit is contained in:
Christoph M. Becker 2016-07-27 19:05:43 +02:00
commit 15f94e93e7
3 changed files with 21 additions and 1 deletions

3
NEWS
View file

@ -18,6 +18,9 @@ PHP NEWS
. Fixed bug #71863 (Segfault when EXPLAIN with "Unknown column" error when
using MariaDB). (Andrey)
- PCRE:
. Fixed bug #72688 (preg_match missing group names in matches). (cmb)
- Reflection:
. Fixed bug #72661 (ReflectionType::__toString crashes with iterable).
(Laruence)

View file

@ -261,7 +261,7 @@ static char **make_subpats_table(int num_subpats, pcre_cache_entry *pce)
subpat_names = (char **)ecalloc(num_subpats, sizeof(char *));
while (ni++ < name_cnt) {
name_idx = 0xff * (unsigned char)name_table[0] + (unsigned char)name_table[1];
name_idx = 0x100 * (unsigned char)name_table[0] + (unsigned char)name_table[1];
subpat_names[name_idx] = name_table + 2;
if (is_numeric_string(subpat_names[name_idx], strlen(subpat_names[name_idx]), NULL, NULL, 0) > 0) {
php_error_docref(NULL, E_WARNING, "Numeric named subpatterns are not allowed");

View file

@ -0,0 +1,17 @@
--TEST--
Bug #72688 (preg_match missing group names in matches)
--FILE--
<?php
$pattern = [];
for ($i = 0; $i < 300; $i++) {
$pattern[] = "(?'group{$i}'{$i}$)";
}
$fullPattern = '/' . implode('|', $pattern) . '/uix';
preg_match($fullPattern, '290', $matches);
var_dump($matches['group290']);
?>
--EXPECT--
string(3) "290"