|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-02-03 10:52 UTC] yohgaki@php.net
[2015-02-03 11:55 UTC] yunosh@php.net
[2021-02-11 11:54 UTC] cmb@php.net
-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: cmb
[2021-02-11 11:54 UTC] cmb@php.net
[2021-02-11 14:43 UTC] yunosh@php.net
[2021-02-11 15:46 UTC] cmb@php.net
-Status: Feedback
+Status: Closed
[2021-02-11 15:46 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 09:00:01 2025 UTC |
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" }