The PHP to C++ Translation tool


For good reason, PHP is a very popular language for publishing web sites with dynamic content. Its strong similarity to C makes the syntax easy to learn for many. The built-in equivalents of many standard C library file, date, string, and time functions make it easy to develop quite complex applications.

For PHP to serve on mission critical web sites, quality assurance becomes essential. However, since it is not a strongly typed language with variable and function declarations, the static error checking is very limited. Many errors, such as missing arguments to functions, are only reported when particular lines of code are run.

By translating the PHP to C++, the excellent static analysis that produces errors and warnings in modern C and C++ compilers can be done on PHP.

A completely no cost and redistributable version of this tool appears with a descriptive article in the March 2002 issue of Dr. Dobb's Journal. We strongly recommend you use the translator only after reading the article. (At a minimum, you must know how to indicate variable types to the translator using "translation hints". The article explains that and other items for successful use.)

The table of PHP features and the C++ translation provides a quick overview of the capabilities of the translator.

An updated and enhanced version of the tool and libraries (and the documentation) is in development and is expected to be available soon. (Updates will be posted to this page.) For now, the Dr. Dobb's article serves the need well. Dr. Dobb's magazine is available on many newsstands and back issues may be available from ddj.com.

Mib Software provides PHP to C++ translation services. Clients benefit from the quality assurance this provides. Othersget the advantages of completely replacing PHP software with working C++.

For DDJ readers, here is the latest version, suitable for producing C++ for lexical scanning.
php2cpp.cpp
php2def.h
libphp.h


Contact us for updated information and professional PHP development, translation, and quality assurance services.
Copyright 2002, Forrest J. Cavalier III
Mib Software
High Reuse Software Development