array_key = key; function PHPJS_Resource (type, id, opener) { // Can reuse the following for other resources, just changing the instantiation // See http://php.net/manual/en/resource.php for types this.type = type; this.id = id; this.opener = opener; } PHPJS_Resource.prototype.toString = function () { return 'Resource id #'+this.id; }; PHPJS_Resource.prototype.get_resource_type = function () { return this.type; }; PHPJS_Resource.prototype.var_dump = function () { return 'resource('+this.id+') of type ('+this.type+')'; };