Bug #71322 [NEW]: output before header() should give error
From: domains dot 30430573 at gmail dot com
Operating system: Windows 7 x64
PHP version: 7.0.2
Package: Output Control
Bug Type: Bug
Bug description:output before header() should give error
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 bug report at https://bugs.php.net/bug.php?id=71322&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71322&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71322&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71322&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=71322&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=71322&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=71322&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=71322&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=71322&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=71322&r=support
Expected behavior: https://bugs.php.net/fix.php?id=71322&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=71322&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=71322&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=71322&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71322&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=71322&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=71322&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=71322&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71322&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=71322&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=71322&r=mysqlcfg
Thread (4 messages)
- domains dot 30430573 at gmail dot com