Skip to content

Commit 0882664

Browse files
Variable name + tests
1 parent 1cb076f commit 0882664

File tree

10 files changed

+18
-42
lines changed

10 files changed

+18
-42
lines changed

Zend/tests/concat/bug79836.phpt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,12 @@ $counter = 0;
88
ob_start(function ($buffer) use (&$c, &$counter) {
99
$c = 0;
1010
++$counter;
11+
return '';
1112
}, 1);
1213
$c .= [];
1314
$c .= [];
1415
ob_end_clean();
1516
echo $counter . "\n";
1617
?>
17-
--EXPECTF--
18-
Deprecated: main(): Returning a non-string result from user output handler {closure:%s:%d} is deprecated in %s on line %d
19-
20-
Deprecated: main(): Returning a non-string result from user output handler {closure:%s:%d} is deprecated in %s on line %d
21-
22-
Deprecated: ob_end_clean(): Returning a non-string result from user output handler {closure:%s:%d} is deprecated in %s on line %d
18+
--EXPECT--
2319
3

Zend/tests/concat/bug79836_1.phpt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@ opcache.optimization_level = 0x7FFEBFFF & ~0x400
77
$x = 'non-empty';
88
ob_start(function () use (&$c) {
99
$c = 0;
10+
return '';
1011
}, 1);
1112
$c = [];
1213
$x = $c . $x;
1314
$x = $c . $x;
1415
ob_end_clean();
1516
echo "Done\n";
1617
?>
17-
--EXPECTF--
18-
Deprecated: main(): Returning a non-string result from user output handler {closure:%s:%d} is deprecated in %s on line %d
19-
20-
Deprecated: ob_end_clean(): Returning a non-string result from user output handler {closure:%s:%d} is deprecated in %s on line %d
18+
--EXPECT--
2119
Done

Zend/tests/concat/bug79836_2.phpt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ $c = str_repeat("abcd", 10);
66

77
ob_start(function () use (&$c) {
88
$c = 0;
9+
return '';
910
}, 1);
1011

1112
class X {
@@ -21,8 +22,5 @@ $x = $c . $xxx;
2122
ob_end_clean();
2223
echo $x . "\n";
2324
?>
24-
--EXPECTF--
25-
Deprecated: X::__toString(): Returning a non-string result from user output handler {closure:%s:%d} is deprecated in %s on line %d
26-
27-
Deprecated: ob_end_clean(): Returning a non-string result from user output handler {closure:%s:%d} is deprecated in %s on line %d
25+
--EXPECT--
2826
abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabc

Zend/tests/declare/gh18033_2.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ob_start(function() {
1111
register_tick_function(
1212
function() { }
1313
);
14+
return '';
1415
});
1516
?>
16-
--EXPECTF--
17-
Deprecated: PHP Request Shutdown: Returning a non-string result from user output handler {closure:%s:%d} is deprecated in %s on line %d
17+
--EXPECT--

Zend/tests/gh11189.phpt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ ob_start(function() {
1818
$a[] = 2;
1919
}
2020
fwrite(STDOUT, "Success");
21+
return '';
2122
});
2223

2324
$a = [];
@@ -29,6 +30,4 @@ while (1) {
2930
?>
3031
--EXPECTF--
3132
Success
32-
Deprecated: main(): Returning a non-string result from user output handler {closure:%s:%d} is deprecated in %s on line %d
33-
3433
Fatal error: Allowed memory size of %s bytes exhausted%s(tried to allocate %s bytes) in %s on line %d

Zend/tests/gh11189_1.phpt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ ob_start(function() {
1818
$a[] = 2;
1919
}
2020
fwrite(STDOUT, "Success");
21+
return '';
2122
});
2223

2324
$a = ["not packed" => 1];
@@ -29,6 +30,4 @@ while (1) {
2930
?>
3031
--EXPECTF--
3132
Success
32-
Deprecated: main(): Returning a non-string result from user output handler {closure:%s:%d} is deprecated in %s on line %d
33-
3433
Fatal error: Allowed memory size of %s bytes exhausted%s(tried to allocate %s bytes) in %s on line %d

Zend/tests/gh16408.phpt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,12 @@ $counter = 0;
66
ob_start(function ($buffer) use (&$c, &$counter) {
77
$c = 0;
88
++$counter;
9+
return '';
910
}, 1);
1011
$c .= [];
1112
$c .= [];
1213
ob_end_clean();
1314
echo $counter . "\n";
1415
?>
15-
--EXPECTF--
16-
Deprecated: main(): Returning a non-string result from user output handler {closure:%s:%d} is deprecated in %s on line %d
17-
18-
Deprecated: main(): Returning a non-string result from user output handler {closure:%s:%d} is deprecated in %s on line %d
19-
20-
Deprecated: ob_end_clean(): Returning a non-string result from user output handler {closure:%s:%d} is deprecated in %s on line %d
16+
--EXPECT--
2117
3

ext/session/tests/user_session_module/bug61728.phpt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ session
55
--FILE--
66
<?php
77
function output_html($ext) {
8-
return strlen($ext);
8+
return (string)strlen($ext);
99
}
1010

1111
class MySessionHandler implements SessionHandlerInterface {
@@ -40,6 +40,5 @@ class MySessionHandler implements SessionHandlerInterface {
4040
session_set_save_handler(new MySessionHandler());
4141
session_start();
4242
?>
43-
--EXPECTF--
44-
Deprecated: ob_end_flush(): Returning a non-string result from user output handler output_html is deprecated in %s on line %d
43+
--EXPECT--
4544
8

main/output.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,8 +1270,8 @@ static int php_output_stack_pop(int flags)
12701270
int handler_count = php_output_get_level();
12711271
if (handler_count) {
12721272
php_output_handler **handlers = (php_output_handler **) zend_stack_base(&OG(handlers));
1273-
for (int iii = 0; iii < handler_count; ++iii) {
1274-
php_output_handler *curr_handler = handlers[iii];
1273+
for (int handler_num = 0; handler_num < handler_count; ++handler_num) {
1274+
php_output_handler *curr_handler = handlers[handler_num];
12751275
if (curr_handler == orphan) {
12761276
still_have_handler = true;
12771277
break;

sapi/cli/tests/gh8827-002.phpt

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ $stderr = fopen('php://stderr', 'r');
1818

1919
ob_start(function ($buffer) use ($stdout) {
2020
fwrite($stdout, $buffer);
21+
return '';
2122
}, 1);
2223

2324
print "STDIN:\n";
@@ -32,20 +33,10 @@ print "STDOUT:\n";
3233
fclose(STDOUT);
3334
var_dump(@fopen('php://stdout', 'a'));
3435
?>
35-
--EXPECTF--
36+
--EXPECT--
3637
STDIN:
37-
38-
Deprecated: main(): Returning a non-string result from user output handler {closure:%s:%d} is deprecated in %s on line %d
3938
bool(false)
40-
41-
Deprecated: var_dump(): Returning a non-string result from user output handler {closure:%s:%d} is deprecated in %s on line %d
4239
STDERR:
43-
44-
Deprecated: main(): Returning a non-string result from user output handler {closure:%s:%d} is deprecated in %s on line %d
4540
bool(false)
46-
47-
Deprecated: var_dump(): Returning a non-string result from user output handler {closure:%s:%d} is deprecated in %s on line %d
4841
STDOUT:
49-
50-
Deprecated: main(): Returning a non-string result from user output handler {closure:%s:%d} is deprecated in %s on line %d
5142
bool(false)

0 commit comments

Comments
 (0)