Prev: cgi
Next: read an xml string from a form field
From: Carsten Wiedmann on 27 Dec 2009 12:12 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
From: Shahar Evron on 27 Dec 2009 13:25 On 27/12/09 17:44 PM, Shahar Evron wrote: > Hi, > > Did it just print out back the stuff you typed in? > > When working with -a don't forget to add the opening '<?php' tag, just > like you would in a regular script. > > BTW on *nix if you build PHP with gettext support there's real > interactive mode support (a command prompt, history, completion, and no > need to type the '<?php' stuff) but I'm not sure if that is available on > Windows. > Hehe stupid me, I meant readline, not gettext Shahar. -- Shahar Evron <shahar.e(a)zend.com> Product Manager Zend Technologies
From: "Sascha Meyer" on 27 Dec 2009 17:44 Hi Carsten, Carsten wrote: > 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. just tried with PHP 5.3 on XP and Windows 7 and both directly output code when the echo command is called, not when the script is terminated. Which PHP version did you use that shows the buggy behaviour? Best regards, Sascha -- Preisknaller: GMX DSL Flatrate f�r nur 16,99 Euro/mtl.! http://portal.gmx.net/de/go/dsl01
From: Ferenc Kovacs on 28 Dec 2009 04:59 On Sun, Dec 27, 2009 at 11:44 PM, Sascha Meyer <harlequin2(a)gmx.de> wrote: > Hi Carsten, > > Carsten wrote: >> 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 >> | >> | # same for me on windows xp 32bit, php 5.3.1. >> 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. > > just tried with PHP 5.3 on XP and Windows 7 and both directly output code when the echo command is called, not when the script is terminated. > Which PHP version did you use that shows the buggy behaviour? > > Best regards, > > Sascha > -- > Preisknaller: GMX DSL Flatrate für nur 16,99 Euro/mtl.! > http://portal.gmx.net/de/go/dsl01 > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
From: Carsten Wiedmann on 28 Dec 2009 06:00
Am 27.12.2009 23:44, schrieb Sascha Meyer: >> | 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. > > just tried with PHP 5.3 on XP and Windows 7 and both directly output code when the echo command is called, not when the script is terminated. > Which PHP version did you use that shows the buggy behaviour? All PHP 5.3.x versions. With PHP 5.2.x it's correct and the same behavior like on *nix. Just curious, if I test this more then one time, sometimes I can see the output with "^C", and sometimes not? BTW: It's always a VC6-TS build and XP SP3 32bit. Regards, Carsten |