467,074 Members | 869 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,074 developers. It's quick & easy.

Interactive mode not very useful

Sal
I'm running PHP 5.2.6 on WindowsXP. When I try interactive mode with
">php -a" the slightest syntax error throws me out of the interpreter
and back to the command line. This is not very useful. Isn't there a
way to stay in interactive mode after a syntax error?
Jun 2 '08 #1
  • viewed: 1515
Share:
3 Replies
On May 30, 6:14 pm, Sal <h...@softcom.netwrote:
I'm running PHP 5.2.6 on WindowsXP. When I try interactive mode with
">php -a" the slightest syntax error throws me out of the interpreter
and back to the command line. This is not very useful. Isn't there a
way to stay in interactive mode after a syntax error?
No - that's not how PHP works. Indeed, apart from a very old version
of Forth, it's not how any programming language I've ever used works.
Try editing the file first then running it.

C.
Jun 2 '08 #2
Sal wrote:
I'm running PHP 5.2.6 on WindowsXP. When I try interactive mode with
">php -a" the slightest syntax error throws me out of the interpreter
and back to the command line. This is not very useful. Isn't there a
way to stay in interactive mode after a syntax error?
Not really. But then if you have a syntax error, your code can't be
executed anyway, so why stay in the interpreter? It would be nice if it
let you correct the error, but it doesn't. That's why I seldom use the
interpreter in interactive mode, and even then only for programs of a
few lines.

In Windows, once you've reentered the interpreter, you can use the
up/down arrow keys to scroll through the keyboard buffer. When you're
in the interpreter you'll have the lines previously entered in the
buffer. A bit awkward, but it does help a little.

Otherwise, I just use an editor to create a file and leave the editor
window open while I test the script.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jun 2 '08 #3
C. (http://symcbean.blogspot.com/) wrote:
On May 30, 6:14 pm, Sal <h...@softcom.netwrote:
>I'm running PHP 5.2.6 on WindowsXP. When I try interactive mode with
">php -a" the slightest syntax error throws me out of the interpreter
and back to the command line. This is not very useful. Isn't there a
way to stay in interactive mode after a syntax error?

No - that's not how PHP works. Indeed, apart from a very old version
of Forth, it's not how any programming language I've ever used works.
Try editing the file first then running it.

C.
I dunno. BASIC used to be like that.
Jun 2 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Christoph Becker-Freyseng | last post: by
6 posts views Thread by Avi Berkovich | last post: by
20 posts views Thread by Joe | last post: by
2 posts views Thread by Charles Krug | last post: by
3 posts views Thread by DGG | last post: by
1 post views Thread by Alex | last post: by
4 posts views Thread by tnoell@gmail.com | last post: by
4 posts views Thread by digitnctu@gmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.