File tree Expand file tree Collapse file tree 11 files changed +48
-15
lines changed
ext/session/tests/user_session_module Expand file tree Collapse file tree 11 files changed +48
-15
lines changed Original file line number Diff line number Diff line change @@ -14,5 +14,10 @@ $c .= [];
1414ob_end_clean ();
1515echo $ counter . "\n" ;
1616?>
17- --EXPECT--
17+ --EXPECTF--
18+ Deprecated: main(): Returning a non-string result from user output handler Closure::__invoke is deprecated in %s on line %d
19+
20+ Deprecated: main(): Returning a non-string result from user output handler Closure::__invoke is deprecated in %s on line %d
21+
22+ Deprecated: ob_end_clean(): Returning a non-string result from user output handler Closure::__invoke is deprecated in %s on line %d
18233
Original file line number Diff line number Diff line change @@ -14,5 +14,8 @@ $x = $c . $x;
1414ob_end_clean ();
1515echo "Done \n" ;
1616?>
17- --EXPECT--
17+ --EXPECTF--
18+ Deprecated: main(): Returning a non-string result from user output handler Closure::__invoke is deprecated in %s on line %d
19+
20+ Deprecated: ob_end_clean(): Returning a non-string result from user output handler Closure::__invoke is deprecated in %s on line %d
1821Done
Original file line number Diff line number Diff line change @@ -21,5 +21,8 @@ $x = $c . $xxx;
2121ob_end_clean ();
2222echo $ x . "\n" ;
2323?>
24- --EXPECT--
24+ --EXPECTF--
25+ Deprecated: X::__toString(): Returning a non-string result from user output handler Closure::__invoke is deprecated in %s on line %d
26+
27+ Deprecated: ob_end_clean(): Returning a non-string result from user output handler Closure::__invoke is deprecated in %s on line %d
2528abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabc
Original file line number Diff line number Diff line change @@ -13,4 +13,5 @@ ob_start(function() {
1313 );
1414});
1515?>
16- --EXPECT--
16+ --EXPECTF--
17+ Deprecated: PHP Request Shutdown: Returning a non-string result from user output handler Closure::__invoke is deprecated in %s on line %d
Original file line number Diff line number Diff line change @@ -26,4 +26,6 @@ while (1) {
2626?>
2727--EXPECTF--
2828Success
29+ Deprecated: main(): Returning a non-string result from user output handler Closure::__invoke is deprecated in %s on line %d
30+
2931Fatal 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 @@ -26,4 +26,6 @@ while (1) {
2626?>
2727--EXPECTF--
2828Success
29+ Deprecated: main(): Returning a non-string result from user output handler Closure::__invoke is deprecated in %s on line %d
30+
2931Fatal 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 @@ -12,5 +12,10 @@ $c .= [];
1212ob_end_clean ();
1313echo $ counter . "\n" ;
1414?>
15- --EXPECT--
15+ --EXPECTF--
16+ Deprecated: main(): Returning a non-string result from user output handler Closure::__invoke is deprecated in %s on line %d
17+
18+ Deprecated: main(): Returning a non-string result from user output handler Closure::__invoke is deprecated in %s on line %d
19+
20+ Deprecated: ob_end_clean(): Returning a non-string result from user output handler Closure::__invoke is deprecated in %s on line %d
16213
Original file line number Diff line number Diff line change @@ -40,5 +40,6 @@ class MySessionHandler implements SessionHandlerInterface {
4040session_set_save_handler (new MySessionHandler ());
4141session_start ();
4242?>
43- --EXPECT--
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
44458
Original file line number Diff line number Diff line change @@ -962,16 +962,16 @@ static inline php_output_handler_status_t php_output_handler_op(php_output_handl
962962
963963 if (SUCCESS == zend_call_function (& handler -> func .user -> fci , & handler -> func .user -> fcc ) && Z_TYPE (retval ) != IS_UNDEF ) {
964964 if (Z_TYPE (retval ) != IS_STRING ) {
965- // Make sure that we don't get lost in an output buffer
966- int old_flags = OG ( flags );
967- OG ( flags ) = old_flags & (~ PHP_OUTPUT_ACTIVATED ) ;
965+ // Make sure that we don't get lost in the current output buffer
966+ // by disabling it
967+ handler -> flags |= PHP_OUTPUT_HANDLER_DISABLED ;
968968 php_error_docref (
969969 NULL ,
970970 E_DEPRECATED ,
971971 "Returning a non-string result from user output handler %s is deprecated" ,
972972 ZSTR_VAL (handler -> name )
973973 );
974- OG ( flags ) = old_flags ;
974+ handler -> flags &= (~ PHP_OUTPUT_HANDLER_DISABLED ) ;
975975 }
976976 if (Z_TYPE (retval ) == IS_FALSE ) {
977977 /* call failed, pass internal buffer along */
Original file line number Diff line number Diff line change @@ -32,10 +32,20 @@ print "STDOUT:\n";
3232fclose (STDOUT );
3333var_dump (@fopen ('php://stdout ' , 'a ' ));
3434?>
35- --EXPECT --
35+ --EXPECTF --
3636STDIN:
37+
38+ Deprecated: main(): Returning a non-string result from user output handler Closure::__invoke is deprecated in %s on line %d
3739bool(false)
40+
41+ Deprecated: var_dump(): Returning a non-string result from user output handler Closure::__invoke is deprecated in %s on line %d
3842STDERR:
43+
44+ Deprecated: main(): Returning a non-string result from user output handler Closure::__invoke is deprecated in %s on line %d
3945bool(false)
46+
47+ Deprecated: var_dump(): Returning a non-string result from user output handler Closure::__invoke is deprecated in %s on line %d
4048STDOUT:
49+
50+ Deprecated: main(): Returning a non-string result from user output handler Closure::__invoke is deprecated in %s on line %d
4151bool(false)
You can’t perform that action at this time.
0 commit comments