Re: PHP console (php.exe -a)

[email protected] (Carsten Wiedmann)
Newsgroups php.windows
Message-ID <[email protected]>
Am 27.12.2009 17:30, schrieb Rasmus Lerdorf:
>> Is there anybody with Linux to try run "php -a" and tell us how to
>> send typed code to execution?
> 
> You just type it in and hit Enter.  There is no trick.  And without
> libreadline there really is no point.

Maybe you have another PHP-CLI then me on *nix (5.2.11)? Without libreadline
it's working a similar way on *nix, of course I have to type the starting
"<?php" myself:
| # php -a
| Interactive mode enabled
|
| <?php
| $a=5;
| $a++;
| echo $a.PHP_EOL;
| 6
At this point I can enter more code. Or exit PHP with:
| ^C
|
| #

But on Windows that's buggy:
| # php -a
| Interactive mode enabled
|
| <?php
| $a=5;
| $a++;
| echo $a.PHP_EOL;
|
Nothing happens on Windows at this point. The cursor is in the next line
waiting for input. But, if I now enter "^C", I can see the result:
| 6
|
| #
So on Windows the whole code/input is executed at once and not step by step.
And because PHP is also terminated with "^C", I can't enter additional code.

Regards,
Carsten
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.