Beispiel #1
0
<?php

$global = Object::$global;
$undefined = null;
$Infinity = INF;
$NaN = NAN;
$Object = Object::getGlobalConstructor();
$Function = Func::getGlobalConstructor();
$Array = Arr::getGlobalConstructor();
$Boolean = Bln::getGlobalConstructor();
$Number = Number::getGlobalConstructor();
$String = Str::getGlobalConstructor();
$Date = Date::getGlobalConstructor();
$Error = Error::getGlobalConstructor();
$RangeError = RangeError::getGlobalConstructor();
$ReferenceError = ReferenceError::getGlobalConstructor();
$SyntaxError = SyntaxError::getGlobalConstructor();
$TypeError = TypeError::getGlobalConstructor();
$RegExp = RegExp::getGlobalConstructor();
$Buffer = Buffer::getGlobalConstructor();
call_user_func(function () use(&$escape, &$unescape, &$encodeURI, &$decodeURI, &$encodeURIComponent, &$decodeURIComponent) {
    $ord = function ($ch) {
        $i = ord($ch[0]);
        if ($i <= 0x7f) {
            return $i;
        } else {
            if ($i < 0xc2) {
                return $i;
                //invalid byte sequence
            } else {
                if ($i <= 0xdf) {