PHP 5.4 has built in web server which helps in executing it without starting Apache.
Steps to follow for testing this feature :
1. Add .PHP extension to the PATHEXT system environment variable
2. Extract the PHP folder and put it separately where you like
3. Open cmd and run cd path to your PHP folder containing the php.exe file (consider the following as in my case)
4. Then run php -S localhost:80 -t path to the folder where you have the php file you want to execute (say test.php as in my case is inside test_web folder)
php -S localhost:80 -t C:\Users\annadap\Desktop\test_web
5. Then something like this will appear on cmd (consider the following as in my case)
PHP 5.4.4 Development Server started at Mon Sep 24 20:09:17 2012
Listening on localhost:80
Document root is C:\Users\annadap\Desktop\test_web
Press Ctrl-C to quit.