Merge branch 'PHP-7.1'

This commit is contained in:
Christoph M. Becker 2016-08-05 13:23:33 +02:00
commit 67786d343a
7 changed files with 104 additions and 50 deletions

View file

@ -68,6 +68,10 @@ PHP 7.1 UPGRADE NOTES
. When calling json_encode with JSON_UNESCAPED_UNICODE option, U+2028 and . When calling json_encode with JSON_UNESCAPED_UNICODE option, U+2028 and
U+2029 are escaped. U+2029 are escaped.
- mbstring:
. mb_ereg() and mb_eregi() will now set the $regs argument to an empty array,
if nothing matched. Formerly, $regs was not modified in that case.
- OpenSSL: - OpenSSL:
. Dropped sslv2 stream. . Dropped sslv2 stream.

View file

@ -713,6 +713,11 @@ static void _php_mb_regex_ereg_exec(INTERNAL_FUNCTION_PARAMETERS, int icase)
RETURN_FALSE; RETURN_FALSE;
} }
if (array != NULL) {
zval_dtor(array);
array_init(array);
}
options = MBREX(regex_default_options); options = MBREX(regex_default_options);
if (icase) { if (icase) {
options |= ONIG_OPTION_IGNORECASE; options |= ONIG_OPTION_IGNORECASE;
@ -751,8 +756,6 @@ static void _php_mb_regex_ereg_exec(INTERNAL_FUNCTION_PARAMETERS, int icase)
match_len = 1; match_len = 1;
str = string; str = string;
if (array != NULL) { if (array != NULL) {
zval_dtor(array);
array_init(array);
match_len = regs->end[0] - regs->beg[0]; match_len = regs->end[0] - regs->beg[0];
for (i = 0; i < regs->num_regs; i++) { for (i = 0; i < regs->num_regs; i++) {

View file

@ -49,7 +49,8 @@ With $regs arg:
Warning: mb_ereg(): empty pattern in %s on line %d Warning: mb_ereg(): empty pattern in %s on line %d
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 2 -- -- Iteration 2 --
Without $regs arg: Without $regs arg:
@ -60,7 +61,8 @@ With $regs arg:
Warning: mb_ereg(): empty pattern in %s on line %d Warning: mb_ereg(): empty pattern in %s on line %d
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 3 -- -- Iteration 3 --
Without $regs arg: Without $regs arg:
@ -71,7 +73,8 @@ With $regs arg:
Warning: mb_ereg(): empty pattern in %s on line %d Warning: mb_ereg(): empty pattern in %s on line %d
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 4 -- -- Iteration 4 --
Without $regs arg: Without $regs arg:
@ -82,7 +85,8 @@ With $regs arg:
Warning: mb_ereg(): empty pattern in %s on line %d Warning: mb_ereg(): empty pattern in %s on line %d
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 5 -- -- Iteration 5 --
Without $regs arg: Without $regs arg:
@ -93,7 +97,8 @@ With $regs arg:
Warning: mb_ereg(): empty pattern in %s on line %d Warning: mb_ereg(): empty pattern in %s on line %d
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 6 -- -- Iteration 6 --
Without $regs arg: Without $regs arg:
@ -104,7 +109,8 @@ With $regs arg:
Warning: mb_ereg(): empty pattern in %s on line %d Warning: mb_ereg(): empty pattern in %s on line %d
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 7 -- -- Iteration 7 --
Without $regs arg: Without $regs arg:
@ -115,7 +121,8 @@ With $regs arg:
Warning: mb_ereg(): empty pattern in %s on line %d Warning: mb_ereg(): empty pattern in %s on line %d
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 8 -- -- Iteration 8 --
Without $regs arg: Without $regs arg:
@ -126,4 +133,5 @@ With $regs arg:
Warning: mb_ereg(): empty pattern in %s on line %d Warning: mb_ereg(): empty pattern in %s on line %d
bool(false) bool(false)
NULL array(0) {
}

View file

@ -27,7 +27,8 @@ array(3) {
[1]=> [1]=>
int(2) int(2)
[2]=> [2]=>
int(3) array(0) {
}
} }
Warning: mb_ereg(): empty pattern in %s on line %d Warning: mb_ereg(): empty pattern in %s on line %d
@ -38,7 +39,8 @@ array(3) {
[1]=> [1]=>
string(0) "" string(0) ""
[2]=> [2]=>
string(0) "" array(0) {
}
} }
Notice: Array to string conversion in %s on line %d Notice: Array to string conversion in %s on line %d
@ -50,7 +52,8 @@ array(3) {
[1]=> [1]=>
int(1) int(1)
[2]=> [2]=>
string(0) "" array(0) {
}
} }
Warning: mb_ereg() expects parameter 2 to be string, array given in %s on line %d Warning: mb_ereg() expects parameter 2 to be string, array given in %s on line %d

View file

@ -113,5 +113,6 @@ array(3) {
string(8) "MTIzNA==" string(8) "MTIzNA=="
} }
bool(false) bool(false)
NULL array(0) {
}
Done Done

View file

@ -95,47 +95,58 @@ echo "Done";
-- Iteration 1 -- -- Iteration 1 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 2 -- -- Iteration 2 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 3 -- -- Iteration 3 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 4 -- -- Iteration 4 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 5 -- -- Iteration 5 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 6 -- -- Iteration 6 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 7 -- -- Iteration 7 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 8 -- -- Iteration 8 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 9 -- -- Iteration 9 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 10 -- -- Iteration 10 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 11 -- -- Iteration 11 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 12 -- -- Iteration 12 --
int(6) int(6)
@ -153,13 +164,16 @@ array(1) {
-- Iteration 14 -- -- Iteration 14 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 15 -- -- Iteration 15 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 16 -- -- Iteration 16 --
bool(false) bool(false)
NULL array(0) {
}
Done Done

View file

@ -112,71 +112,88 @@ echo "Done";
-- Iteration 1 -- -- Iteration 1 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 2 -- -- Iteration 2 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 3 -- -- Iteration 3 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 4 -- -- Iteration 4 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 5 -- -- Iteration 5 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 6 -- -- Iteration 6 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 7 -- -- Iteration 7 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 8 -- -- Iteration 8 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 9 -- -- Iteration 9 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 10 -- -- Iteration 10 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 11 -- -- Iteration 11 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 12 -- -- Iteration 12 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 13 -- -- Iteration 13 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 14 -- -- Iteration 14 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 15 -- -- Iteration 15 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 16 -- -- Iteration 16 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 17 -- -- Iteration 17 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 18 -- -- Iteration 18 --
int(3) int(3)
@ -194,19 +211,23 @@ array(1) {
-- Iteration 20 -- -- Iteration 20 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 21 -- -- Iteration 21 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 22 -- -- Iteration 22 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 23 -- -- Iteration 23 --
bool(false) bool(false)
NULL array(0) {
}
-- Iteration 24 -- -- Iteration 24 --