2

Like the way we can use python in command line from its command line interpreter in order to test whether small code snippets are fine or not, how can I do the same with PHP (or can I)?

ActivePython 2.7.2.5 (ActiveState Software Inc.) based on
Python 2.7.2 (default, Jun 24 2011, 12:22:14) [MSC v.1500 64 bit (AMD64)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> print "abc"
abc
>>>

C:\wamp\bin\php\php5.3.4>php -a
Interactive mode enabled

doesn't give me php prompt

can someone show an example on how do have an interactive shell in php.

1 Answer 1

3

The PHP Manual has a section on command line usage.

There's also details on an interactive shell.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for the link. I am aware of this link but I was looking for an interactive shell that we get in python. Is there a way I can use a similar interactive shell in php. something like when I write echo "Hello World!", it instantly prints "Hello World"
I looked into that.. It doesn't work.. (check my updated post)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.