People seem to be divided into 3 camps.
Some people are saying things like:
"but php is a programming language..."
"it is a full-fledged programming language; it's actually quite similar to c++, and also offers classes, which I consider a powerful feature"
Then again others are saying:
"by official definition I would imagine, I don't like thinking of it as one"
"someone i know is making a php bnc, but in all other cases, Php is scripting to me"
The third group of people chime in with:
"well, sure it's a programming language, but it's still a scripting language. Traditional programming languages allow stand-alone applications, which PHP doesn't yet"
I would like to start this formal discussion with an example of how you can run a PHP piece of code from the command line, outside of the context of a web rendering engine.
When you download and decompress PHP, you end up with a directory that looks like this:
CONSOLE
C:\Apache\Apache\php>dir
Directory of C:ApacheApachephp
08/15/2007 11:24 AM <DIR> .
08/15/2007 11:24 AM <DIR> ..
05/23/2006 08:00 AM <DIR> cli
05/23/2006 08:00 AM <DIR> dlls
05/23/2006 08:00 AM <DIR> extensions
02/16/2003 12:02 AM 32,881 install.txt
02/15/2003 11:20 PM 3,276 license.txt
02/15/2003 11:20 PM 36,823 magic.mime
05/23/2006 08:00 AM <DIR> mibs
02/15/2003 11:20 PM 142,387 news.txt
05/23/2006 08:00 AM <DIR> openssl
05/23/2006 08:00 AM <DIR> pdf-related
02/16/2003 12:02 AM 45,056 php.exe
02/15/2003 11:20 PM 3,872 php.gif
02/15/2003 11:20 PM 38,898 php.ini-dist
02/15/2003 11:20 PM 39,502 php.ini-recommended
02/15/2003 11:20 PM 7,952 php4embed.lib
02/15/2003 11:58 PM 1,282,048 php4ts.dll
02/15/2003 11:20 PM 169,956 php4ts.lib
05/23/2006 08:00 AM <DIR> sapi
08/15/2007 11:23 AM 47 standalone.php
07/13/2006 03:58 PM <DIR> uploadtemp
12 File(s) 1,802,698 bytes
10 Dir(s) 278,102,016 bytes free
C:\Apache\Apache\php>
Directory of C:ApacheApachephp
08/15/2007 11:24 AM <DIR> .
08/15/2007 11:24 AM <DIR> ..
05/23/2006 08:00 AM <DIR> cli
05/23/2006 08:00 AM <DIR> dlls
05/23/2006 08:00 AM <DIR> extensions
02/16/2003 12:02 AM 32,881 install.txt
02/15/2003 11:20 PM 3,276 license.txt
02/15/2003 11:20 PM 36,823 magic.mime
05/23/2006 08:00 AM <DIR> mibs
02/15/2003 11:20 PM 142,387 news.txt
05/23/2006 08:00 AM <DIR> openssl
05/23/2006 08:00 AM <DIR> pdf-related
02/16/2003 12:02 AM 45,056 php.exe
02/15/2003 11:20 PM 3,872 php.gif
02/15/2003 11:20 PM 38,898 php.ini-dist
02/15/2003 11:20 PM 39,502 php.ini-recommended
02/15/2003 11:20 PM 7,952 php4embed.lib
02/15/2003 11:58 PM 1,282,048 php4ts.dll
02/15/2003 11:20 PM 169,956 php4ts.lib
05/23/2006 08:00 AM <DIR> sapi
08/15/2007 11:23 AM 47 standalone.php
07/13/2006 03:58 PM <DIR> uploadtemp
12 File(s) 1,802,698 bytes
10 Dir(s) 278,102,016 bytes free
C:\Apache\Apache\php>
Please note the existence of the executable php.exe.
I created a little PHP piece of code in a file called standalone.php:
CONSOLE
C:\Apache\Apache\php>type standalone.php
<? echo "I am a standalone PHP application." ?>
C:\Apache\Apache\php>
<? echo "I am a standalone PHP application." ?>
C:\Apache\Apache\php>
Let's imagine for a moment that Apache isn't installed on my PC and let's try to execute that PHP piece of code:
CONSOLE
C:\Apache\Apache\php>php standalone.php
Content type: text/html
X-Powered-By: PHP/4.3.1
I am a standalone PHP application.
C:\Apache\Apache\php>
Content type: text/html
X-Powered-By: PHP/4.3.1
I am a standalone PHP application.
C:\Apache\Apache\php>
There is a way to suppress the extra fluff at the beginning of the output, by specifying the "-q" (for quiet) flag:
CONSOLE
C:\Apache\Apache\php>php -q standalone.php
I am a standalone PHP application.
C:\Apache\Apache\php>
I am a standalone PHP application.
C:\Apache\Apache\php>
Edit: I just realized now, after looking over my posting again, that putting stuff inside the console tag interprets the backslash as an escape character, so wherever you see C:ApacheApachephp - it was originally
CODE
C:\Apache\Apache\php


