Bug #68977 [Fbk]: Regression with linebreaks returned from exec()

From: Date: Thu, 11 Feb 2021 14:43:31 +0000
Subject: Bug #68977 [Fbk]: Regression with linebreaks returned from exec()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-232059@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68977&edit=1 ID: 68977 Updated by: yunosh@php.net Reported by: yunosh@php.net Summary: Regression with linebreaks returned from exec() Status: Feedback Type: Bug Package: Program Execution Operating System: Linux PHP Version: 5.4Git-2015-02-03 (Git) Assigned To: cmb Block user comment: N Private report: N New Comment: Unfortunately 3v4l.org doesn't support exec(), so it's hard to test. Previous Comments: ------------------------------------------------------------------------ [2021-02-11 11:54:16] cmb@php.net Does this still happen with any of the actively supported PHP versions[1]? [1] <https://www.php.net/supported-versions.php> ------------------------------------------------------------------------ [2015-02-03 11:55:18] yunosh@php.net I tried with 5.6 from rasmus' vagrant box, and the bug wasn't there. ------------------------------------------------------------------------ [2015-02-03 10:52:49] yohgaki@php.net I think I've seen the same issue for release version. It would be nicer add this to the bug report. ------------------------------------------------------------------------ [2015-02-03 10:36:37] yunosh@php.net Description: ------------ exec() doesn't return empty lines from execution results as empty strings, but as newline characters. Test script: --------------- cmd.php: #!/usr/bin/env php Line one Line two Line three Line four test.php: <?php exec(__DIR__ . '/cmd.php', $result, $value); var_dump($result); Expected result: ---------------- array(5) { [0]=> string(8) "Line one" [1]=> string(8) "Line two" [2]=> string(0) "" [3]=> string(10) "Line three" [4]=> string(9) "Line four" } Actual result: -------------- array(5) { [0]=> string(8) "Line one" [1]=> string(8) "Line two" [2]=> string(1) " " [3]=> string(10) "Line three" [4]=> string(9) "Line four" } ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68977&edit=1

« previous php.bugs (#232059) next »