Feature comparison

Jun 17, 2009




Coding languages

C, C++. It also supports some OOP concepts.

More than 25 languages supported, among which the most widely used are Visual Basic .NET and C#. A developer can choose one language but still be able to use components from any other supported language.

Compiling logic

It's compilable and can be run as an executable.

Compilation supported, in both dynamically and pre-compiled modes.

Output caching (full page)

No native support.

Supported. By any combination of one or several URL parameters, browser type or custom function ASP.NET caches different versions of a page.

Output caching (partial page)

No native support.

Native support through the use of User Controls. Using the Cache API, data and other objects can be cached with complex expiration rules.

External components

PHP can call a variety of packages and the ZEND engine can be manually modified by the developer because it is in open source.

Broad support for native C libraries, COM objects as well as assemblies written in any .NET compatible language, including Managed C++.

Database access

PHP has drivers for most available databases on the market, as well as open source databases.

ASP.NET directly supports OLE-DB and ODBC, while including native drivers for Microsoft SQL Server and Oracle.

Database output

PHP returns datasets as variables, so they are outputted like any other variable.

ASP.NET has templated data binding to server-side controls for ease of development, and a developer can choose manual looping according to his preferences.

XML Web services

PHP packages support Web services based on Apache AXIS engine and others.

Extensive and flexible standards-compliant support is provided which make Web services easy to publish and consume.


Are supported in add-on packages and libraries.

ASP.NET provides comprehensive and easy to use support for XML DOM, XSLT, validation, while enabling lightweight stream-oriented parsing for XML documents.

Built-in functionality

Built-in functions that cover many common tasks for a Web-based application. Java class libraries can also be accessed with additional work.

ASP.NET brings direct access to the entire .NET framework class libraries, which encompass a vast amount of functionality.

Session State

PHP has cookie based session management.

With or without cookies session state, by using a single server in-memory store, a centralized state server or a database back-end. The extensible architecture allows custom state modules to replace built-in options. The cookieless sessions require only a configuration change to be enabled.


Does not offer direct extensive debugging support. Several products from third-parties and Zend are available for debugging and testing.

ASP.NET includes extensive tracing and environment information that can be included in the same page or a separate one. Microsoft Visual Studio .NET enables easy interactive debugging of pages while executing, on top of debugging fro client-side scripting and SQL Server stored procedures.

Regular expressions

PHP supports POSIX and Perl compatible regular expressions syntax.

Perl-5 compatible regular expression support, with extra features like right-to-left matching, precompiled expressions, named groups or full Unicode support. ASP.NET allows the user to specify a function to be called while making a regular expression replace operation.

Error handling

Although it does not support error trapping, it has various error-handling functionality and logging.

Has support for structured exception handling, by adding a “finally” block after code that executes regardless of errors it may contain, for raising custom exceptions, and specifying custom error pages for different types of unrecoverable errors.

Image manipulation

PHP has no built-in actual support, except for third-party components that can be installed.

Through the .NET System.Drawing classes, ASP.NET includes extensive image creation and manipulation facilities.

Data caching

Limited data native Data Caching.

Extensive cache API that allows almost any type of data to be stored, with expiration based upon usage, time, or dependency upon a file or another cached item. ASP.NET also allows user-defined functions to be called when given item is removed from the cache.


Unicode full support.

Unicode strings and various character encodings supported. Rather than requiring different functions to be called, date, number, and currency functions are culture-aware, altering their output according to the type of culture they are currently set to. ASP.NET includes support for using resource files to dynamically localize an application.

Code re-usability

PHP has user defined functions, the ability to create Classes, and included files.

Has User Controls, Server Controls, custom classes, and included files.


Good threading model.

Full support. Simultaneous page requests take place in separate threads, and moreover, each page is able to spawn its own threads in order to perform simultaneous or asynchronous work.

Integrated development environment

From free to several hundred dollars, PHP can be completed by a bundle of development tools with a broad range of capabilities.

Visual Web Developer Express Edition is a free tool for .NET development from Microsoft.

Visual Studio .NET is the most popular tool which includes full support for all .NET languages, database tools for creating SQL and testing databases, Web Design tools, integration with version controls, advanced debugging and several other features.

Borland C# Builder and Macromedia Dreamweaver MX also support ASP.NET.

1. Migrating from PHP to ASP.NET - Introduction
2. Feature comparison
3. Architecture and object oriented programming capabilities
4. Compilation
5. Data and page caching