Bug #71322 [Fbk->Opn]: output before header() should give error

From: Date: Sat, 09 Jan 2016 23:38:57 +0000
Subject: Bug #71322 [Fbk->Opn]: output before header() should give error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-198552@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71322&edit=1

 ID:                 71322
 User updated by:    domains dot 30430573 at gmail dot com
 Reported by:        domains dot 30430573 at gmail dot com
 Summary:            output before header() should give error
-Status:             Feedback
+Status:             Open
 Type:               Bug
 Package:            Output Control
 Operating System:   Windows 7 x64
 PHP Version:        7.0.2
 Block user comment: N
 Private report:     N

 New Comment:

output_buffering=4096

I just changed to output_buffering=Off and the script works as it should


Previous Comments:
------------------------------------------------------------------------
[2016-01-09 23:27:10] requinix@php.net

Do you have output buffering enabled?

------------------------------------------------------------------------
[2016-01-09 21:42:37] domains dot 30430573 at gmail dot com

Description:
------------
output before header() should give error, but no warning is shown and the header is actually sent
(HTTP 403, in this case)

*NOTE* I am testing this with PHP 7.0.1 via XAMPP

Test script:
---------------
<?php
echo 'Some string';
header('HTTP/1.1 403 Forbidden');


Expected result:
----------------
PHP Warning:  Cannot modify header information - headers already sent by (output started at
Z:\test\file.php:2) in Z:\test\file.php on line 3


Actual result:
--------------
HTTP 1.1 403 Forbidden
------------------------
Some string



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=71322&edit=1


Thread (4 messages)

« previous php.bugs (#198552) next »