php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42992 headers_sent() gets crazy after calling empty files via virtual()
Submitted: 2007-10-16 14:22 UTC Modified: 2007-10-16 20:33 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (50.0%)
From: hamdi at rawasy dot com Assigned:
Status: Not a bug Package: Apache related
PHP Version: 4.4.7 OS: Irrelevant
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: hamdi at rawasy dot com
New email:
PHP Version: OS:

 

 [2007-10-16 14:22 UTC] hamdi at rawasy dot com
Description:
------------
The virtual() function works great, but not headers_sent()!

headers_sent() returns true with an empty string as filename & indicates that the line number is zero!

Reproduce code:
---------------
<?php
virtual("empty.php");	// An empty file
var_dump(headers_sent($file, $line), $file, $line);
?>

Expected result:
----------------
bool(false)
string(0) ""
int(0)


Actual result:
--------------
bool(true)
string(0) ""
int(0)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-16 20:33 UTC] johannes@php.net
virtual() does an apache sub-request - PHP has no clue what happens inside there.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 20:01:36 2025 UTC