StaXML for PHP Web Gateway: Last Updated 2004/03/26
Learn more about StaXML in general and about StaXML for PHP at their web pages or by reading the paper.
Demonstration scripts
These pithy scripts are intended to demonstrate the basic capabilities of the StaXML for PHP pre-compiler. Three StaXML variants are available: "simple" (StaXMLS), "fullxml" (StaXMLF), and "aggressivefullxml" (a combination of StaXMLA and StaXMLF).
Validate your own script
Limitations
-
The precompiler assumes you will only use echo or flat extra-script literals to produce script output. Any use of output filters or file descriptors or other mechanisms to produce output will be ignored.
-
Only the aggressivefullxml variant recognizes XML tags which are not constructed as static strings. That means that
$x = "<p>";
is okay in all systems but
$x = "<p" . ">";
will only be recognized as valid by aggressivefullxml (and it will not be able to recognize all such constructions).
-
Support for arrays is currently BETA. It should work, but if it fails (spectacularly or otherwise) please let me know. Support for records (arrays in which data is always accessed using static keys) is PRE-ALPHA, expect such structures to be treated like arrays.
-
Support for other compound data types (classes/objects) is currently ALPHA; it might work (don't count on it) and it might (probably) cause the compiler to (spectacularly) self-destruct.
-
Support for static and global variables within functions is currently ALPHA; again, expect results ranging between perfection, subtle failure, and spectacular self-destruction.
-
The precompiler is aware of and has types for all of the core PHP library functions. Function types are assigned in a special control file which is read on every invocation; simply reading the definitions of the core library already takes over a second on this current host, adding all the extension libraries would make startup time far worse.
-
The include variants won't work in the gateway, so don't even think about using them to hack it.
-
Recursion support is very limited. If a function is called recursively, the precompiler checks to see if it can have any side-effects besides producing output. If it can, we give up. If it can't, we hypothesize that it returns a block of balanced, well-formed XML; if this hypothesis fails, we give up and assign the function a GENERALSTRING return type.
-
For complete details, please refer to the paper.
Privacy, Confidentiality, etc
- The server discards all copies of any uploaded scripts as soon as the precompiler finishes execution. We are not stealing your code.
- The gateway keeps very rudimentary usage statistics. We store hashed IP addresses only as a way of approximating the number of users.