Wez Furlong wrote:
Resources are the traditional approach for mapping an arbitrary
pointer to PHP space, managing its lifetime safely.
PHP 5 OO support allows for similar things, but maps the pointer as a
PHP object.
They're similar in some ways, but different in others. The biggest
functional difference (aside from OO) is that you can't create
persistent objects (ala mysql_pconnect())--you have to use resources
for that.
It's usually faster to write a procedural extension using resources
than it is to write an OO extension using PHP 5 objects, although the
latter can be more accessible to the consumers of your extension.
Resources: work with PHP 4. Can be persistent.
Objects: work with PHP 5 and up.
There is no hard and fast rule about which one you choose; just use
the one the makes most sense for the task at hand.
ah, much clearer now, thanks.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php