Bug #70018 [Opn->Csd]: exec does not strip all whitespace
| From: | laruence@php.net | Date: | Wed, 08 Jul 2015 11:36:05 +0000 |
| Subject: | Bug #70018 [Opn->Csd]: exec does not strip all whitespace | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-194205@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70018&edit=1
ID: 70018
Updated by: laruence@php.net
Reported by: robbert at muze dot nl
Summary: exec does not strip all whitespace
-Status: Open
+Status: Closed
Type: Bug
Package: Program Execution
Operating System: Debian jessie
PHP Version: master-Git-2015-07-08 (Git)
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=da333bfbd8ed9820922957cea70a562454548d84
Log: Fixed bug #70018 (exec does not strip all whitespace)
Previous Comments:
------------------------------------------------------------------------
[2015-07-08 08:20:57] robbert at muze dot nl
forgot to add, the expected output is from the following php version
PHP 5.6.9-1 (cli) (built: May 22 2015 10:48:57)
------------------------------------------------------------------------
[2015-07-08 08:17:45] robbert at muze dot nl
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 this bug report at https://bugs.php.net/bug.php?id=70018&edit=1