Bug #71624 [Opn->Asn]: `php -R` (PHP_MODE_PROCESS_STDIN) is broken

From: Date: Sun, 13 Mar 2016 03:23:48 +0000
Subject: Bug #71624 [Opn->Asn]: `php -R` (PHP_MODE_PROCESS_STDIN) is broken
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-199785@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71624&edit=1 ID: 71624 Updated by: seander@php.net Reported by: dana at dana dot is Summary: php -R (PHP_MODE_PROCESS_STDIN) is broken -Status: Open +Status: Assigned Type: Bug Package: CGI/CLI related PHP Version: 7.0.3 -Assigned To: +Assigned To: seander Block user comment: N Private report: N New Comment: Hi! I opened a PR fixing this, would you mind trying it out and see if it works for you? thanks for reporting Previous Comments: ------------------------------------------------------------------------ [2016-02-18 12:19:28] dana at dana dot is Description: ------------ It looks like between 5.6 and 7.0 somebody broke the CLI utility's -R option. Specifically: * $argi is always 0 * $argn always has the last character cut off I've confirmed it works as expected in PHP 5.6.14 on OS X, whilst it's broken in 7.0.2 on OS X and master on Ubuntu. I'm not very good at C, so i don't have a patch, i'm sorry. Test script: --------------- % php -R 'echo "${argi}\n";' <<< $'foo\nbar' % php -R 'echo "${argn}\n";' <<< $'foo\nbar' Expected result: ---------------- % php --version | head -1 PHP 5.6.14 (cli) (built: Oct 3 2015 14:54:13) % php -R 'echo "${argi}\n";' <<< $'foo\nbar' 1 2 % php -R 'echo "${argn}\n";' <<< $'foo\nbar' foo bar Actual result: -------------- % php --version | head -1 PHP 7.0.2 (cli) (built: Jan 7 2016 10:40:26) ( NTS ) proserpina:php % php -R 'echo "${argi}\n";' <<< $'foo\nbar' 0 0 proserpina:php % php -R 'echo "${argn}\n";' <<< $'foo\nbar' fo ba ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=71624&edit=1

« previous php.bugs (#199785) next »