On 11.11.2015 03:21, Andrea Faulds wrote:
The reason for this is that the resource type is an anachronism from an age in which PHP did not have objects, yet still needed to make certain types of data opaque. The resource type is a type that exists only to shuffle around C pointers between internal functions. It has no semantic value. Because resources are now redundant, given the existence of objects, their time is running out, and they will be replaced at some point. Adding a type declaration for resource would mean that code using it would break if we replace any existing usage of resources with objects, preventing migration away from resource.
I see, I didn't really know about this. Although right now, we still use resources to pass around the fopen() pointers. Do you mean that it is planned to have a read/write object like we have in e.g. Python (supplied by the open() function)?
-- Ben Scholzen 'DASPRiD' Community Review Team Member | m...@dasprids.de Zend Framework | http://www.dasprids.de -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php