WHAT'S NEW?
Loading...

Using PHP Interpreter for Immediate Execution Results

This time I got to test a code in PHP. So, i should write the script in some text editor, make sure if local server is running or not and navigate to browser time and again to see the results of change in code.

THIS IS SERIOUSLY TIME CONSUMING AND BORING.

So, why not use PHP interpreter from command line?
Most developers working on Linux platform are more interested to work with commands because task is faster with commands. It's same even for other platforms.

Using PHP interpreter from command line really makes the testing of some small code snippets easy and faster. To be more specific, we can test the php functions working and outputs.

In Ubuntu 14.04,
The path of PHP is already added to the environment variable. So php command can be executed from any directory. If you have installed php from a zip file, the path of PHP directory should be added for global access to php command. Otherwise, navigate to the directory that contains php command and execute the command.

The command to run interactive PHP interpreter is:
php -a

Now input can be made just like in other interpreters and termination symbol should be input at the end of each statements.

CODING IS FASTER OBVIOUSLY!

0 comments:

Post a Comment