ID: 29606 Comment by: nadie_20 at hotmail dot com Reported By: [EMAIL PROTECTED] Status: Closed Bug Type: Output Control PHP Version: 5CVS-2004-08-10 (dev) New Comment:
lñllllllllllllllll Previous Comments: ------------------------------------------------------------------------ [2004-08-11 14:46:01] [EMAIL PROTECTED] This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. ------------------------------------------------------------------------ [2004-08-10 23:15:12] [EMAIL PROTECTED] Description: ------------ The proto and description of php_strip_whitespace() indicate it should return a stripped string. It does not do this and instead outputs the stripped code to stdout. It looks like the function IS intended to return the stripped string as the code uses output buffering, but the problem lies in php_strip(). Unlike highlight_file() which uses zend_printf()'s and ZEND_PUTC()'s and what-have-you so output buffering works and the result is captured, php_strip() is hardcoded to output to stdout which means the output buffering intended for php_strip_whitespace() doesn't work and an empty string is returned for this function. It also means, for Apache, since stdout goes nowhere (I think?), nothing is even outputted to the browser. Fixing this would also close #28280. (same function, different issue) Reproduce code: --------------- <?php /* ... */ var_dump(php_strip_whitespace($_SERVER['SCRIPT_FILENAME'])); ?> Expected result: ---------------- string(63) "<?php var_dump(php_strip_whitespace($_SERVER['SCRIPT_FILENAME'])); ?>" Actual result: -------------- CLI: <?php var_dump(php_strip_whitespace($_SERVER['SCRIPT_FILENAME'])); ?> string(0) "" Apache: string(0) "" ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29606&edit=1