Re: ext/gd: support creation of animated GIFs
| From: | Christoph M. Becker | Date: | Mon, 09 Jan 2017 23:08:52 +0000 |
| Subject: | Re: ext/gd: support creation of animated GIFs | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-97648@lists.php.net to get a copy of this message | ||
On 09.01.2017 at 21:21, Andrea Faulds wrote:
> Joe Watkins wrote:
>
>> We have to face facts: Resources are still a thing.
>>
>> While there is talk of switching resources to use opaque objects, I'm
>> worried about introducing a mixture of objects and resources in random
>> places throughout core exts, and having exts with both seems very strange
>> to me.
ACK.
>> I know that this has already started to happen, but before it goes any
>> further I would implore you to stick to resources for now.
>
> The more things are made objects now, the less things need to be
> converted to be objects later.
ACK.
> It might be “strange” to mix them, but would it actually cause
> confusion? So far as the user cares, resources and objects returned by
> Gd could just be integers. They're just opaque handles.
I think that they *should* be opaque handles, but you never know how
one's going to treat them. Presumably the most crucial point nowadays
are type declarations; changing a resource to be an object could cause
massive BC break (think of streams) – changing all resources to objects
appears to be even impracticable for a major version. Therefore I think
this has to be done in small steps ("eating the elephpant one bite at a
time"), and so introducing new opaque handles as objects appears
somewhat sensible even if that causes a mix of resources and objects in
a single extension.
Anyhow, I understand that the animated GIF support will need an RFC, and
there should be a secondary voting option whether the API should use a
resource or an opaque object.
--
Christoph M. Becker