3v4l.org

run code in 300+ PHP versions simultaneously
<?php ob_end_clean(); header("Connection: close"); ignore_user_abort(); // optional ob_start(); echo ('Text the user will see'); $size = ob_get_length(); header("Content-Length: $size"); ob_end_flush(); // Strange behaviour, will not work flush();            // Unless both are called ! // Do processing here sleep(30);echo('Text user will never see');?>
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Notice: ob_end_clean(): Failed to delete buffer. No buffer to delete in /in/87N4H on line 7 Warning: Cannot modify header information - headers already sent by (output started at /in/87N4H:7) in /in/87N4H on line 8 Text the user will see Warning: Cannot modify header information - headers already sent by (output started at /in/87N4H:7) in /in/87N4H on line 12 Notice: ob_end_flush(): Failed to delete and flush buffer. No buffer to delete or flush in /in/87N4H on line 13
Process exited with code 137.
Output for 5.3.7 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.33
Notice: ob_end_clean(): failed to delete buffer. No buffer to delete in /in/87N4H on line 7 Warning: Cannot modify header information - headers already sent by (output started at /in/87N4H:7) in /in/87N4H on line 8 Text the user will see Warning: Cannot modify header information - headers already sent by (output started at /in/87N4H:7) in /in/87N4H on line 12 Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush in /in/87N4H on line 13
Process exited with code 137.
Output for 7.3.32 - 7.3.33
Text the user will see Warning: Cannot modify header information - headers already sent by (output started at /in/87N4H:10) in /in/87N4H on line 12
Process exited with code 137.

preferences:
180 ms | 401 KiB | 253 Q