File tree Expand file tree Collapse file tree 10 files changed +18
-42
lines changed
ext/session/tests/user_session_module Expand file tree Collapse file tree 10 files changed +18
-42
lines changed Original file line number Diff line number Diff line change @@ -8,16 +8,12 @@ $counter = 0;
88ob_start (function ($ buffer ) use (&$ c , &$ counter ) {
99 $ c = 0 ;
1010 ++$ counter ;
11+ return '' ;
1112}, 1 );
1213$ c .= [];
1314$ c .= [];
1415ob_end_clean ();
1516echo $ 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--
23193
Original file line number Diff line number Diff line change @@ -7,15 +7,13 @@ opcache.optimization_level = 0x7FFEBFFF & ~0x400
77$ x = 'non-empty ' ;
88ob_start (function () use (&$ c ) {
99 $ c = 0 ;
10+ return '' ;
1011}, 1 );
1112$ c = [];
1213$ x = $ c . $ x ;
1314$ x = $ c . $ x ;
1415ob_end_clean ();
1516echo "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--
2119Done
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ $c = str_repeat("abcd", 10);
66
77ob_start (function () use (&$ c ) {
88 $ c = 0 ;
9+ return '' ;
910}, 1 );
1011
1112class X {
@@ -21,8 +22,5 @@ $x = $c . $xxx;
2122ob_end_clean ();
2223echo $ 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--
2826abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabc
Original file line number Diff line number Diff 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--
Original file line number Diff line number Diff 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--
3132Success
32- Deprecated: main(): Returning a non-string result from user output handler {closure:%s:%d} is deprecated in %s on line %d
33-
3433Fatal error: Allowed memory size of %s bytes exhausted%s(tried to allocate %s bytes) in %s on line %d
Original file line number Diff line number Diff 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--
3132Success
32- Deprecated: main(): Returning a non-string result from user output handler {closure:%s:%d} is deprecated in %s on line %d
33-
3433Fatal error: Allowed memory size of %s bytes exhausted%s(tried to allocate %s bytes) in %s on line %d
Original file line number Diff line number Diff line change @@ -6,16 +6,12 @@ $counter = 0;
66ob_start (function ($ buffer ) use (&$ c , &$ counter ) {
77 $ c = 0 ;
88 ++$ counter ;
9+ return '' ;
910}, 1 );
1011$ c .= [];
1112$ c .= [];
1213ob_end_clean ();
1314echo $ 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--
21173
Original file line number Diff line number Diff line change 55--FILE--
66<?php
77function output_html ($ ext ) {
8- return strlen ($ ext );
8+ return ( string ) strlen ($ ext );
99}
1010
1111class MySessionHandler implements SessionHandlerInterface {
@@ -40,6 +40,5 @@ class MySessionHandler implements SessionHandlerInterface {
4040session_set_save_handler (new MySessionHandler ());
4141session_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--
45448
Original file line number Diff line number Diff 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 ;
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ $stderr = fopen('php://stderr', 'r');
1818
1919ob_start (function ($ buffer ) use ($ stdout ) {
2020 fwrite ($ stdout , $ buffer );
21+ return '' ;
2122}, 1 );
2223
2324print "STDIN: \n" ;
@@ -32,20 +33,10 @@ print "STDOUT:\n";
3233fclose (STDOUT );
3334var_dump (@fopen ('php://stdout ' , 'a ' ));
3435?>
35- --EXPECTF --
36+ --EXPECT --
3637STDIN:
37-
38- Deprecated: main(): Returning a non-string result from user output handler {closure:%s:%d} is deprecated in %s on line %d
3938bool(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
4239STDERR:
43-
44- Deprecated: main(): Returning a non-string result from user output handler {closure:%s:%d} is deprecated in %s on line %d
4540bool(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
4841STDOUT:
49-
50- Deprecated: main(): Returning a non-string result from user output handler {closure:%s:%d} is deprecated in %s on line %d
5142bool(false)
You can’t perform that action at this time.
0 commit comments