Edit report at https://bugs.php.net/bug.php?id=62982&edit=1
ID: 62982 Updated by: a...@php.net Reported by: luis dot pessoa67 at ibest dot com dot br Summary: php [options] [-B <begin_code>] -R <code> [-E <end_code>] -Status: Feedback +Status: Not a bug Type: Bug Package: Scripting Engine problem Operating System: Windos 7 SP1 PHP Version: 5.4Git-2012-08-31 (Git) Block user comment: N Private report: N New Comment: On windows shell you cannet use single quotes to wrap strings, use double quotes for that dir /aa /b | Debug_TS\php.exe -B "$l=0;$i=1;" -R "$l+=count(@file($argv[$i++]));" -E "echo 'files: ' . $l;" That's the basic windows cmd behaviour. Previous Comments: ------------------------------------------------------------------------ [2012-08-31 15:47:33] ras...@php.net Works fine for me on Linux: > ls | php53 -B '$l=0;$i=1;' -R '$l+=count(@file($argv[$i++]));' -E 'echo > "files: $l\n";' files: 449 Weird Windows thing? ------------------------------------------------------------------------ [2012-08-31 15:06:28] luis dot pessoa67 at ibest dot com dot br Description: ------------ --- >From manual page: http://www.php.net/features.commandline.options --- Why Didn't it work? c:\php>dir /aa /b | php -B '$l=0;$i=1;' -R '$l+=count(@file($argv[$i++]));' -E 'echo "files: $l\n";' Parse error: syntax error, unexpected end of file in Command line begin code on line 1 Parse error: syntax error, unexpected ''echo' (T_ENCAPSED_AND_WHITESPACE) in Com mand line end code on line 1 c:\php>php -v PHP 5.4.5 (cli) (built: Jul 18 2012 22:25:51) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies Test script: --------------- c:\php>dir /aa /b | php -B '$l=0;$i=1;' -R '$l+=count(@file($argv[$i++]));' -E 'echo "files: $l\n";' Expected result: ---------------- files: XXXXX Actual result: -------------- Parse error: syntax error, unexpected end of file in Command line begin code on line 1 Parse error: syntax error, unexpected ''echo' (T_ENCAPSED_AND_WHITESPACE) in Com mand line end code on line 1 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=62982&edit=1