Extension:Foxway

The Foxway extension adds in the wikitext parser the ability to use the syntax and functions of PHP.

It has its own implementation of the interpreter and runtime for PHP code, and never use direct run custom code in PHP interpreter installed on your computer
 * This extension does not allows run php code! It works the same way as other extensions like Extension:ParserFunctions, but instead of using wiki syntax, uses the syntax of PHP.
 * This extension does not allow creation of raw HTML pages, because MediaWiki parser processes the foxway outputs like any other text

You can see examples and try it in sandbox namespace.

...

Usage
The tag is used to embed blocks of PHP code into wikitext, which are then executed. The standard PHP functions  may be used to pass output back to the parser.

All variables declarations persist from one block/expression to the next, throughout the page. Complicated expressions and calculations can thus easily be separated from their presentation

Implemented support for most of the functions PHP (array, Math, Regular expression, String and Variable handling Functions)

See also other examples

Features

 * Easy to install: No additional libraries
 * Easy to use: Syntax is similar to PHP
 * Powerful: Has many functions for work with variables, strings, arrays, regular expressions
 * Customizable: You can specify the namespaces and functions, which is available for use with this extension
 * Integrated Debugger: Debug toolbar shows the step by step execution of operations and the values of variables

Configuration parameters

 * $wgFoxwayFunctions: Contains an array of implemented functions, which is available to users. You can disable any of the functions are at your discretion.
 * $wgNamespacesWithFoxway: For specifying the namespaces in which is allowed to use the extension Foxway.