Skip to content
Emanuele Minotto edited this page Apr 30, 2016 · 4 revisions

It's suggested to create the unused PHP main function.

if (!function_exists('main')) {
    function main() {
        static $mf;

        if (is_null($mf)) {
            $mf = require_once 'crystal.php';
        }

        return call_user_func_array($mf, func_get_args());
    }
}

main('/', function () {
    echo 'Hello World!';
});
Clone this wiki locally