How to access a PHP resource

I am using a third-party PHP module that returns a php resource:

resource(1, ABCResult)

The manual describes how to use the returned object, I'm not sure how to access the object?

The code looks something like this:

$resource = get_new_resource_based_on('this-information');

var_Dump($resource) outputs:

resource(1, ABCResult)

The manual states the following:

The method checks the username and password of the account owner.

The method returns an instance of the ABCResult class.

Methods of returned instances of the ABCResult class: Success returns true if there is a user with a username and password, otherwise false

The text is an error if the user does not have a username / password pair.

It returns an ID if the user was found with the same username and password

+4
2

- blob, . - , ; , gd-, gd- -, . " PHP", . - ; .

/, . " " "" - , , . , .

+1
source

I would call it bad documentation. From the documentation it can be seen that it could be something like this:

$resource = get_new_resource_based_on('this-information');
if ($resource->success()) {
    echo 'User ID = '.$resource->ID;
} else {
    echo 'Error: '.$resource->error;
}
0
source

All Articles