Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124318 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 8C14E1A00D3 for ; Tue, 9 Jul 2024 18:06:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1720548450; bh=b0NNkBgjuSFR7HNI3m1Lghm8URCtR9w20X+Dk00STEY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=JYr986GvK/PSOZMF8hMi2MVWs4PyI0azcfqJHyV6jgC+zTKfNevwWNJ7K91AJu30o zN9YeFSS0+G91tvbSolsrlESIppY9em+g+fudXtyfTSpYdQWgvv2cD4OtoIsIeI9zW 1ya52+ABm9lGmENPGyU5rGMzg5z0UYkl8Oi5oy6vfEKrfQ1DWW5frx+YSYi2F2lwlY 5xqcl17dyFG9VLlahtlg0Mej17Z9DW+YrubY8B5wWiv3dlGOGPAZ5OP/LrSAQud3VG qiRMejTQQBP1f6u94GkeQ58jaVkWt5Woe7LFSD2TkhU4rNercpS8TcMaRYG4sOmqHk 16vSAIabBu5UQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DA40F18170C for ; Tue, 9 Jul 2024 18:07:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 9 Jul 2024 18:07:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1720548360; bh=x/QOkroLiJvtEL1N9lf7CZ8JzD9S2w5nrTzQmGpVO+0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=Q32UY3M7lJHBtH9YXA6jiZIkI31ycbDtDRjF8h4tFbvWC/uhb4etMxi6dopZAlXDv eaEGiHxdyeFBZihEot49dA1P8eo7T4SaGTZ1ZlmbKqHWO9KW0I17TnUdLYh69GKSrJ MUIRZFXw07ba3BxXb/6AjwxB9m9OoR22VavX42SGE5KGXzwHSHeJtbWKQsmYPYQdpG WEeLY86SLSUaPanrTaN4qyBN31d5py/Lm2P9ODbq0muipJpNNnlNIBjWKOw9v8Bn0j 4fUrDkQxfJUG+tAskg7gKySeWDqKM+CP4CV0TaWQFjD2P4wfEdG9mGFXPfR3R43VIC 6wrdMs9S0GBMQ== Message-ID: <1a03ee20-ebc3-4406-abaf-9e939bffa784@bastelstu.be> Date: Tue, 9 Jul 2024 20:05:58 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Subject: Re: [PHP-DEV] ext/gd adding imagecompare To: Kamil Tekiela , David CARLIER Cc: PHP internals References: Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) 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