Neometric Software’s PHP Studio 1.1 is designed to make PHP programmers’ lives a little easier by helping them write programs faster and test them more easily. It includes several tools that are designed to help programmers work with PHP code, access helpful reference material, and make sure that programs actually run before they are posted on a live Web server.
While it has some interesting and useful features, such as PHP syntax coloring and advanced search-and-replace, it lacks many helpful items like soft word wrap, brace balancing, and file comparison, which are available in free text editors like Bare Bones Software’s TextWrangler 2.0 ( May 2005 ). In addition, several performance problems—the inability to open some PHP files and glacially slow performance on large files, means this text editor isn’t for the full-time PHP programmer.;
Text editing for programmers
PHP Studio 1.0 is a basic text editor that includes a few programmer-specific additions such as line numbering (which makes it easier to track down errors) and syntax coloring (which lets you quickly identify different language elements such as functions, comments, and keywords).
The Auto-Complete feature provides access to PHP functions that match what you’ve begun to type. This feature can save you a few keystrokes, but it doesn’t include common language constructs like include and foreach . In addition, automatically enabling Auto-Complete causes a function menu to pop up constantly, even in places where a function call wouldn’t make sense. I found this confusing and unnecessary. The company says it’s working on a fix.
An integrated function drawer lists all user-defined functions (collections of programming code) in a document, including all the parameters that function accepts. Clicking a function from the list displays all variables defined within that function. Unfortunately, the advertised ability to use this list to add variables to a document by simply double-clicking doesn’t work in Tiger (though Neometric plans to fix this in a forthcoming update).
To further speed up the process of writing PHP code, a Functions menu provides a quick way to insert a call to a user-defined function, complete with text placeholders for each of the function’s parameters.
Incomplete editing features
Despite its fine qualities, PHP Studio feels incomplete as a dedicated PHP editor. It lacks many of the features you’d expect in a Web programming environment (and which you can get for free in TextWrangler), such as soft-wrapping for long lines of code, the ability to select Mac, Windows, or Unix line endings, to balance braces, to compare two versions of a document, and to open and save to a Web server via FTP. The company has acknowledged these issues and is researching how to implement improvements.
It would also be nice if the program had a tabbed document window, like Safari, so you could switch between documents by just clicking a tab. PHP Studio opens each file in a separate window, but that becomes unwieldy if you’re working on several files simultaneously.
Tests are off base
PHP Studio offers two ways to test a PHP program: the Compile button and the Execute button. The compile button is supposed to check the syntax of your program for coding errors, but it just doesn’t give useful or accurate feedback. It’s also unclear why the Compile button is offered at all, since the program’s Execute button, which actually runs the PHP code, also informs you of syntax errors and correctly indicates the line on which an error occurs.
If your program is free of syntax errors, PHP Studio should open a new window showing the output from the program—though this didn’t work with database connections and some documents that used included files —and it isn’t a substitute for actually running the PHP file through a Web server and previewing it in a real Web browser.
PHP Studio includes a few other interesting, post-programming tools. The Clean tool strips your document of comments and extra white space, saving on file size. The Export tool exports your program as HTML, complete with syntax coloring—a useful way of posting code on PHP forums to ask for help or to show off your programming chops. PHP Studio also has impressive search-and-replace tools, including support for regular expressions.
Macworld’s buying advice
While it’s nice to see a dedicated PHP editor for the Mac, PHP Studio feels rough around the edges, lacks useful text-editing features, and is marred by bugs and performance problems when working with large and complex PHP files. Neometric Software has acknowledged these issues and is researching how to add functionality to the program in future releases. For now, I’d stick with TextWrangler.
[ David Sawyer McFarland is a Web developer and author of Dreamweaver MX 2004: The Missing Manual (O’Reilly, 2004). ]PHP Studio’s Function Drawer provides a list of a file’s user-defined functions, which includes all parameters that each function accepts.