Re: [php6] OOP resources
2014-02-22 5:07 GMT+09:00 Marc Bennewitz <[email protected]>:
> Hi,
>
> here another idea for PHP 6 the simply means removing the datatype
> "resource" because and convert current resources into classes/objects
> as it's already done with GMP.
>
> Because resources are simply a pointer to a somewhere described data
> structure - resources are the exactly the use case for objects.
>
> To be bc current resources should be instances of an interface
> "Resource" and the function "is_resource" would work similar as
> "$resource instanceof Resource".
I prefer resource as It makes easier to implement bindings.
I've maintained several extensions. one of the library has 500
approximates APIs.
Imagine considering complicated OOP interface is really nightmare...
To encapsulate resource data structure to object isn't bad idea.
but zend_list_insert is more convenient than
zend_object_store_get_object, isn't it?
I think ambiguity is one of good point of PHP.
Thread (10 messages)