From:             [EMAIL PROTECTED]
Operating system: Linux
PHP version:      5.2.4RC1
PHP Bug Type:     Session related
Bug description:  header() cannot be used after echo on CLI

Description:
------------
When issuing a header() call in a php command line script (php cli) after
I used 'echo', the message 'headers already sent' pops up.

It should be possible to use header(), session_id_generate() and other
session related functions after outputting something on CLI - since headers
are not sent on cli.

(The use case we have is unit-testing packages on cli)

Reproduce code:
---------------
<?php
echo 'a';
header('sadf');
?>


Expected result:
----------------
a

Actual result:
--------------
a
Warning: Cannot modify header information - headers already sent by
(output started at /data/cvs/pear/sessionbug.php:2) in
/data/cvs/pear/sessionbug.php on line 3

Call Stack:
    0.0003      83688   1. {main}() /data/cvs/pear/sessionbug.php:0
    0.0006      83988   2. header() /data/cvs/pear/sessionbug.php:3


-- 
Edit bug report at http://bugs.php.net/?id=42197&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42197&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42197&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42197&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=42197&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=42197&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=42197&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=42197&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=42197&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=42197&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=42197&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=42197&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=42197&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=42197&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42197&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=42197&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=42197&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=42197&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42197&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=42197&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=42197&r=mysqlcfg

Reply via email to