Bug #70018 [NEW]: exec does not strip all whitespace

From: Date: Wed, 08 Jul 2015 08:17:46 +0000
Subject: Bug #70018 [NEW]: exec does not strip all whitespace
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-194201@lists.php.net to get a copy of this message
From: robbert at muze dot nl Operating system: Debian jessie PHP version: master-Git-2015-07-08 (Git) Package: Program Execution Bug Type: Bug Bug description:exec does not strip all whitespace Description: ------------ exec does not remove the first char in a line of output, if it is whitespace if the line only contains " \n" the " " isn't striped Test script: --------------- <?php $output = array(); exec('/bin/echo -n -e "abc\f\n \n"',$output); var_dump($output); Expected result: ---------------- array(2) { [0]=> string(3) "abc" [1]=> string(0) "" } Actual result: -------------- array(2) { [0]=> string(3) "abc" [1]=> string(1) " " } -- Edit bug report at https://bugs.php.net/bug.php?id=70018&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70018&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70018&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70018&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=70018&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=70018&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=70018&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=70018&r=needscript Try newer version: https://bugs.php.net/fix.php?id=70018&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=70018&r=support Expected behavior: https://bugs.php.net/fix.php?id=70018&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=70018&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=70018&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=70018&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70018&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=70018&r=dst IIS Stability: https://bugs.php.net/fix.php?id=70018&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=70018&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=70018&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=70018&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=70018&r=mysqlcfg

« previous php.bugs (#194201) next »