Re: ext/gd adding imagecompare

From: Date: Tue, 09 Jul 2024 18:05:58 +0000
Subject: Re: ext/gd adding imagecompare
References: 1 2  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hi

Yes, please no more global constants with names that are shortened beyond all recognition.

On 7/9/24 18:59, Kamil Tekiela wrote:
Boolean is a much more confusing value here. A bit mask is ok, but I would prefer a better solution. Maybe a simple value object?
If it's "simple" then it would also be unwieldy to use. To me the obvious modern alternative would be a list of enum cases that represent the differences, with an empty array meaning no differences. The function should probably be renamed 'imagediff()' or similar then.
    namespace Gd;
    enum ImageDifference {
        case Height;
        case Width;
        case AlphaChannel; // or: case Transparency
        case Interlacing;
        // ...
    }
Best regards Tim Düsterhus

Thread (10 messages)

« previous php.internals (#124318) next »