Add Ons - DevSource
DevSource: Microsoft Developer Resource DevSource Home Sponsored by Microsoft Home Add Ons Architecture Languages Techniques Using VS Forums
Home arrow Add Ons arrow Page 2 - VS.PHP Brings PHP Coding Power to Visual Studio
VS.PHP Brings PHP Coding Power to Visual Studio
By Bob Reselman

Rate This Article: Add This Article To:

VS.PHP Brings PHP Coding Power to Visual Studio - ' The User Experience '
( Page 2 of 4 )

Working the IDE

VS.PHP really is about writing PHP code within the Visual Studio environment. Thus, everything that I knew how to use in VS.NET was readily available in VS.PHP. Adding new and existing items to a PHP project was no different than adding items to a C# or VB project. The class browser did a good job of showing me my classes, independent of file location. I could view a PHP class's methods and fields just as I would under a C# or VB project.

ADVERTISEMENT

The code edit window is straight-ahead Visual Studio. If the file being edited has more than one class defined, you select the class from the top left drop-down. The right drop-down displays a list of the class's constructors and methods. The code window supports Intelli-Sense's display of a variable's options, and the standard PHP functions are listed when you strike Ctrl+Spacebar.

VS.PHP ships with a whole bunch of PHP libraries that you add to the Visual Studio PHP project as references. Once a reference is added, the libraries — such as one for MySQL support — are available for auto-select.

Also, VS.PHP supports code complete of object variables. But more about this later.

Runtime errors are reported using the PHP runtime engine. So, unlike a standard .NET project — where you get you a very detailed exception dump from the Common Language Runtime (CLR) — VS.PHP provides the standard PHP error dump into the Web page in which the error occurs. The PHP runtime reports the error's file and line location and a brief error message (best understood by experienced PHP developers).

Server Side Debugging

After the initial Hello World run, I put some break points in the PHP code. I had no problem examining a variable's value using QuickWatch and subsequently assigning a variable to a watch List.

VS.PHP provided a fully-functional Autos window. However, when I tried to go back into my code using the Visual Studio Set Next Statement from the cursor's context menu, I discovered that the feature seemed not to be supported. Thus, moving back in code was a problem.

Client Side Debugging

Just as I had done previously in the server side code, I set a breakpoint in client side Javascript that was in a JS file separate from the PHP code, and I added client side Javacript variables to a watch list. No problem.

I did run into a bit of a problem when I was trying to debug client side code that was inline in a PHP file. When I set a breakpoint in the Javascript portion of the PHP file, upon the break VS.PHP sent me off into the PHP code. It did not break exactly on the Javascript line.



 
 
>>> More Add Ons Articles          >>> More By Bob Reselman
 



HD VOIP Has Arrived (with Tony Konstner)

Play Video >

All Videos >

Google and blonde jokes?

Read now >

Favorite books!

Read now >

View Now
DevSource RSS FEEDS
XML Want an easy way to keep up with breaking tech news? And the Get DevSource headlines delivered to your desktop with RSS.