Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127477 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 lists.php.net (Postfix) with ESMTPS id C6A951A00BC for ; Tue, 27 May 2025 08:00:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1748332703; bh=15N0H3ixvVn8ncjy6QRf98WVkz0Y06WJtzbOCQKtLsY=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=HSZErJQyUewTmoZitks/U2iW8hgr0sUzWWh0KyqRfZEMuCr8JMOiyAaupu7vmD/AQ PrMN9NkQ4gpFZAS9CD58wWXzhS8g92uDO0WFurnmZFBUxOxBfiTRCK+VdpbTVj3jTI kQo0jtfT2iR92Ijg9nSZQpGIpiNFIRMhi0zSkDGZQNjFtP3bOZ4g2WjkybBqohjgNS eW1N7bNco7uuLWqTzbC3t6BRFV95bYBLZnjWBZ7LVz0WqbA34eHqoxHFdIfUJEO5oA 4aLBemurG44/LdPoOO1nWIUsxN0t4GtgtpN1poSbI+1alD5p6gvyId9TftGkSXfIlX ooofgju9Fl4xw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 21A5D180061 for ; Tue, 27 May 2025 07:58:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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, 27 May 2025 07:58:19 +0000 (UTC) Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-442eb5d143eso32630025e9.0 for ; Tue, 27 May 2025 01:00:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1748332825; x=1748937625; darn=lists.php.net; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=ga1kN6MMTel6j5irJQR8r+DgCM4ZgPGSvE6Y23fVl04=; b=ImiL88z2hsEMJXRFkuftsbXaSicdl0AB6OrWUhlQbJTiipG15/a+U+ixxIE9gC4Aq9 OAPo0Y+35P618kggDXeRcw3MKOBoFg0zuvCXXZ92ElQTUlFMLKJBG8l2Ogf94q+ZO1cv 2QMWeQwiO8uhKggfiZbBgXTIhOSIezsSqV73EXszi/MGXc7HF2e2KmLUq41b0Awz8S7r Z0IerA4AjQ2aGg8Ix6R1SXDWegmWExHCgVWdhAn8hdQOMjDexzOS5g6ndVSXmUwcVB+L 6u1Mwy7+k7ZeHsw3reXdJvbNHA3lUPVpqU5NIdjmpgRy6sTfN4522E5SlIR2HtJjWM4V ZzYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748332825; x=1748937625; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ga1kN6MMTel6j5irJQR8r+DgCM4ZgPGSvE6Y23fVl04=; b=cWnZw+n472E2aAfXBa0PjNUBzaJwqkEI0dF16JyXq4n5oaiQ7B5wZRwfayPu9fDb1L 2h/Sm+wLwQbDK70yAfpqKwDGpCVAb7E4FJmOEEzphel2BuBs+ylIbRMAhOSBq/Uyn2Vg N3VWOHxpMVg6dLcL5b7XOxWM5id2VaEgcCBrvtA34MaZLtmDo0y9FTqPAGA0plU3Bpc3 X/cJhdZc+ngKMrHzAkiZEo7qlTXIDyM2w0QfoA3EkUpcet7PA6L1jg49TVqhTA9dWAin JJiJjLiydanQZQS53Ivl4LFRXMg0W2dkOXrmKnhMf7VALMF81Eba/ImoDoURAV8S0fHM 3njA== X-Gm-Message-State: AOJu0Yzb4HL8XwWFbvlQs6Bty6qK2zit0PbUgLffz3BXcXKjdeFji4ma Qd4gyMAx5YnrrTg9Z40N4JlxI5bsZVIucb72tHXn3BUk00pGe+uYoBGM X-Gm-Gg: ASbGnctrobCduKobOshwUq8Osqbr85WT4wOavXr0rDQ/mdOKPL72oI5g6+1bS7dkycG ou60m0kXoGjZwpNTyR9IZRjH6ojeM/apwoAi/+3tiQEET34/ikgPZiiXSgFy4aPaSfWUf+hLbj+ HzBEBAV6iOGpXwchCHlJ5aI9vaCOWpbzfc6WU6tjMB5Wom8tMtMmslE+dp1sfnEez+GUvbBkYJm trXDqzm6WNacF5mR/9aXvod/A75DYcDQ6Q13DysQpd64eAvhbV5UPGRxEw0NJfp28vfRWH1K/Ub meT4bH7KKbu4hbr9i3Wkd8PcLjKAxHt+7aIfFoBg2ZPNEnamqd245C84X/OYcOzubzHqXprA6Gk = X-Google-Smtp-Source: AGHT+IGKodIKKO0NpuJlmguvBOqpOQLJMWhDjUVT7FrzvDSR+Ma7YQTS0VdmFYyS6Cu0+W9pGQtZmQ== X-Received: by 2002:a05:600c:34d3:b0:441:b19c:96fe with SMTP id 5b1f17b1804b1-44c91ad6cc6mr134645465e9.10.1748332825142; Tue, 27 May 2025 01:00:25 -0700 (PDT) Received: from smtpclient.apple ([89.249.45.14]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-447f381465fsm261271275e9.29.2025.05.27.01.00.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 May 2025 01:00:24 -0700 (PDT) Message-ID: <639E0BE3-F1F7-49F3-801F-721C87134063@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_1F459738-89CC-4B57-96C6-5BD44442C156" Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: Re: [PHP-DEV] ext/gd: changing signatures for functions returning true Date: Tue, 27 May 2025 10:00:12 +0200 In-Reply-To: Cc: PHP internals To: David CARLIER References: X-Mailer: Apple Mail (2.3826.600.51.1.1) From: claude.pache@gmail.com (Claude Pache) --Apple-Mail=_1F459738-89CC-4B57-96C6-5BD44442C156 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > Le 27 mai 2025 =C3=A0 00:51, David CARLIER a = =C3=A9crit : >=20 > Hi, >=20 > Working through this https://github.com/php/php-src/pull/18651/files, = do not mind waiting for PHP 9 if needs be. Let me know what you think. >=20 > Cheers. Hi, Those functions are documented to return false on failure (e.g. = https://www.php.net/manual/en/function.imagesetthickness.php). For that = reason, I typically check for failure (e.g., `if (! = imagesetthickness(...)) { return false; }`). If some or all functions of the gd library do not or no longer return = false, please amend the documentation, so that I (and everyone else, see = e.g. https://phpstan.org/r/a69b0ad4-b4bd-4487-a6d1-a436ce142dc2 ) know = that those checks are useless without needing to read the php source = code. But don=E2=80=99t just change the return type from `bool` to `void`: you = are needlessly breaking existing code. Thanks! =E2=80=94Claude= --Apple-Mail=_1F459738-89CC-4B57-96C6-5BD44442C156 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
Le 27 mai = 2025 =C3=A0 00:51, David CARLIER <devnexen@gmail.com> a =C3=A9crit = :

Hi,

Working through this https://github.co= m/php/php-src/pull/18651/files, do not mind waiting for PHP 9 if = needs be. Let me know what you = think.

Cheers.
=


Hi,

<= div>Those functions are documented to return false on failure = (e.g. http= s://www.php.net/manual/en/function.imagesetthickness.php). For that = reason, I typically check for failure (e.g., `if (! = imagesetthickness(...)) { return false; }`).

If = some or all functions of the gd library do not or no longer return = false, please amend the documentation, so that I (and everyone else, see = e.g. https:= //phpstan.org/r/a69b0ad4-b4bd-4487-a6d1-a436ce142dc2 ) know = that those checks are useless without needing to read the php source = code.

But don=E2=80=99t just change the return = type from `bool` to `void`: you are needlessly breaking existing code. = Thanks!

=E2=80=94Claude
= --Apple-Mail=_1F459738-89CC-4B57-96C6-5BD44442C156--