From: t...@php.net Operating system: FreeBSD, MacOSX PHP version: 5.2.9 PHP Bug Type: Output Control Bug description: headers_sent() reports 'true' after system() call in ob_start()
Description: ------------ This is the php -v from one of the servers: PHP 5.2.9 with Suhosin-Patch 0.9.7 (cli) (built: Apr 9 2009 03:31:34) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies This is another one (macosx): PHP 5.2.9 (cli) (built: Apr 2 2009 16:07:08) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies with Xdebug v2.0.4, Copyright (c) 2002-2008, by Derick Rethans Right after my system() call, headers were send. This works differently in 5.2.6 and 5.2.8. I've scanned through UPDATING/CHANGELOG but couldn't find anything. I've disabled APC to make sure it's not connected. php -m: [PHP Modules] ctype date dom filter iconv libxml mbstring mcrypt mysqli pcre Reflection session SimpleXML sockets SPL standard tidy xml zlib Also reproduced with RC1 on 5.3: PHP 5.3.0RC1 (cli) (built: Apr 9 2009 15:45:09) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies Reproduce code: --------------- <?php ob_start(); system('file -i -b /path/file.txt'); $contents = ob_get_contents(); ob_end_clean(); var_dump(headers_sent($file, $line), $file, $line); Expected result: ---------------- headers_sent() should return false. Actual result: -------------- headers_sent() returns true, with empty $file and $line = 0. -- Edit bug report at http://bugs.php.net/?id=47937&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47937&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47937&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47937&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=47937&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47937&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=47937&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=47937&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=47937&r=needscript Try newer version: http://bugs.php.net/fix.php?id=47937&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=47937&r=support Expected behavior: http://bugs.php.net/fix.php?id=47937&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=47937&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=47937&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=47937&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47937&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=47937&r=dst IIS Stability: http://bugs.php.net/fix.php?id=47937&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=47937&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=47937&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=47937&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=47937&r=mysqlcfg