2011/7/7 Richard Quadling <[email protected]>:
> 2011/7/6 Johannes Schlüter <[email protected]>:
>> On Wed, 2011-07-06 at 16:46 +0100, Richard Quadling wrote:
>>> 2011/7/6 Johannes Schlüter <[email protected]>:
>>> > On Tue, 2011-07-05 at 16:50 +0100, Richard Quadling wrote:
>>> >> C:\php5\php.exe --verbose -f d:\docs\phd\render.php -- --verbose
>>> >
>>> > That happens with all options.
>>> > $ php -n run-tests.php -n
>>> >
>>>
>>> You missed out the --
>>>
>>> That separates arguments from php.exe and the script.
>>>
>>> As long as one remembers that, they should be OK.
>>
>> This is not needed usually:
>>
>> $ cat t.php
>> <?php
>> print_r($argv);
>>
>>
>> $ php -n t.php -n
>> Array
>> (
>> [0] => t.php
>> [1] => -n
>> )
>
> On windows ...
>
>>copy con C:\t.php
> <?php
> print_r($argv);
> ^Z
> 1 file(s) copied.
>
>>php -v
> PHP 5.3.7RC3-dev (cli) (built: Jul 4 2011 14:05:17)
> Copyright (c) 1997-2011 The PHP Group
> Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
>
>
>>C:\PHP5\php.exe -n -f C:\t.php -n
> Array
> (
> [0] => C:\t.php
> )
>
>>C:\PHP5\php.exe -n -f C:\t.php -- -n
> Array
> (
> [0] => C:\t.php
> [1] => -n
> )
>
>
> php --help specifically shows this too.
Aha!
>C:\PHP5\php.exe -n C:\t.php -n -- -j
Array
(
[0] => C:\t.php
[1] => -n
[2] => --
[3] => -j
)
Without -f, all arguments after the script name belong to the script.
Without -f, argument order becomes important.
--
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php