Re: A curious thing...about tags. [message #182224 is a reply to message #182223] |
Mon, 22 July 2013 10:30 |
Norman Peelman
Messages: 126 Registered: September 2010
Karma:
|
Senior Member |
|
|
On 07/22/2013 05:15 AM, Alex vdB wrote:
>>>> php > $something="my text";
>>>> php > $run="?> $something <?";
>>>> php > echo $run;
>>>> ?> my text <?
>>>>
>>> In my setup that produces no output at all.
>>> Mind you php -a doesnt produce any output from
>>> php> echo "this";
>>>
>>> either..
>>>
>>> Nor even a command prompt
>>>
>>> It just sits there...
>>
>> Under OS X that echoes this, IYSWIM.
>
> I guess you all have different default options/settings.
>
> Mine just outputs: echo "this";
> as expected, because it isn't processed as PHP, because it is missing <?php
> I do need to give end of file before anything is output.
>
> php -a
> <?php $run="?> something <";
> echo $run;
>
> outputs "?> something <?" just fine, again once the input is closed with
> end of file.
>
> and the following produces "?> something <?", once the EOF is received:
> php -a
> <?php
> $saysomething="something";
> $run="?> $saysomething <?";
> echo $run;
>
>
> Maybe try "php -n -a" and don't forget EOF as well as the php opening tag.
norman@amd64x2:~$ php -a
Interactive shell
php > <?php
php > $something = "something";
Parse error: syntax error, unexpected '<' in php shell code on line 1
That doesn't fly here... You seem to be in Interactive Mode not
Interactive Shell, there is a difference.
http://php.net/manual/en/features.commandline.interactive.php
--
Norman
Registered Linux user #461062
-Have you been to www.php.net yet?-
|
|
|