/** * Creates the global constructor used in user-land * @return Func */ static function getGlobalConstructor() { $RegExp = new Func(function () { $reg = new RegExp(); $reg->init(func_get_args()); return $reg; }); $RegExp->set('prototype', RegExp::$protoObject); $RegExp->setMethods(RegExp::$classMethods, true, false, true); return $RegExp; }