Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127754 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 6D4CD1A00BC for ; Wed, 25 Jun 2025 14:08:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1750860388; bh=VrvWCI/TsU5JbGLqkyWwEXRMPTI0qWojiDr7TQHVIdM=; h=Date:From:To:In-Reply-To:References:Subject:From; b=b6ENwK4sfKsHAEXDQ+ZtwKxogd2a2K1ke9xSbMwZDx3L3lNCRawwwn9c5AOB93gjp BkPpoDsKM9OcYiRGr4WkKfFnyLXBXfmuohlSFbyw9MvoFDvWI++5fpQVpgHbQ3NlQw eVfG0sZngW1of2sb6FfTqLXwQGu07Ut5O4V+nBE0LOQYCjnwaaZsXgFcJQ5GuEkCo8 C+febqW/KNoi/QjVBMQ7uOnmWyoYGR8JQVKYoOleorNOCp4NDFAL4SxST5cmz5I3QK 8zZ/e0U6jKtEIefz54ZQ9oWRLUnphzK6vWPRpRCxENh73TFnBOel2Mn5gAvagIgp4l +Bqz+3FRYb+3A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C573C1801D9 for ; Wed, 25 Jun 2025 14:06:27 +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=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE 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 fhigh-b5-smtp.messagingengine.com (fhigh-b5-smtp.messagingengine.com [202.12.124.156]) (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 ; Wed, 25 Jun 2025 14:06:27 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfhigh.stl.internal (Postfix) with ESMTP id 8BA627A00C4 for ; Wed, 25 Jun 2025 10:08:22 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-10.internal (MEProxy); Wed, 25 Jun 2025 10:08:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm2; t=1750860502; x=1750946902; bh=N3lXNAxOa6ii6dhnbk+GY VK6HPGFayHLLdEioEh/gZ8=; b=raBsN+7DR9AwjfIv/k7+ejwdNW15ZCeWbFmEA NEiLN40HFpNaX8etzOJoI1xEHFKd90hkusGj/Zp1pBZdCdRvfla5jghq6mTQCgpo jgAtfOpGpiOHkC8IwgI+d9f86iemq49+Ij7SoDnHfaEjNJMmph4EMmcWyvOdPPs2 WrhERiaDssQey7Q4r43lCxoOADmrSPsT+WH5KXetjoqmIssAUP3AGO3TJ9D2VXKQ Zyov/exT8iEhoVxOYKJ3Ke24pET+S13WgMCEP8vVdlt5iuG0eNtmRvhCRFA7Wp/K E7TZ6gEZQBnI8lYd3c88kpG5OtvobAS821gs18y3klMlHgtfw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1750860502; x=1750946902; bh=N 3lXNAxOa6ii6dhnbk+GYVK6HPGFayHLLdEioEh/gZ8=; b=TFBXX9zgN/JN+maBE 1ZLCP5OGfUF21Uyc1MCJVGk8gRvT/X5Ds41IGWW1X2NzWVnSbnF8Y3I+9gIm64dq fC7U53f+TWFzyiLmfH6qcKcvgw+qmxcz2c97jQ8lVUDbmLuvlZ1IHaA2dcdw1DLN t6i3JVrtYSr4vuxSbCjT/rl+NbJIGVhA/G/SkGMTjcv3T3kfXDJa+gu60kkIu3Sc kQQ0B26iKEch+R+Z8J+PKE9WgDjb7YNWY6m8VDi5o5zcTTKWOVaGpqThMnSuqVqv 4pBzLiU+ImlwH+9Wv2mjJnofiBwgy/uqB2jE/5axTUKYw5KqWGLD93RVL02MFEdi sCXuA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddvgddvvdeljecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefoggffhffvkfgjfhfutgfgsehtjeertdertddtnecuhfhrohhmpedfnfgrrhhrhicu ifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomheqne cuggftrfgrthhtvghrnhepiedtieevueeuudfhjeetfeehffefueetleeuueejvdeuleel ieegudevhfdvkeelnecuffhomhgrihhnpehgihhthhhusgdrtghomhdpghgrrhhfihgvlh guthgvtghhrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmpdhnsggprhgtph htthhopedupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehinhhtvghrnhgrlhhs sehlihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 09EDE700069; Wed, 25 Jun 2025 10:08:22 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: T3dfebf74b60a4495 Date: Wed, 25 Jun 2025 09:08:01 -0500 To: "php internals" Message-ID: In-Reply-To: References: Subject: Re: [PHP-DEV] Make Reflection*::getDocComment() return an empty string instead of false Content-Type: text/plain Content-Transfer-Encoding: 7bit From: larry@garfieldtech.com ("Larry Garfield") On Wed, Jun 25, 2025, at 5:37 AM, Gina P. Banyard wrote: > Hello internals, > > While working on the deprecation to/from bool type juggling in > functions RFC and seeing the impact within Symfony, we found a common > slightly annoying case. > The getDocComment method of various Reflection classes was always used > as a string, and we thought changing the behaviour in PHP made more > sense. > > I submitted a PR [1] but was asked to gather feedback on the mailing list. > > Please let me know what you think. > > Best regards, > > Gina P. Banyard > > [1] https://github.com/php/php-src/pull/18928 The use of false as a sentinel value is always wrong[1], so I agree with the issue. Whether the BC break is worth it is a harder question. Whether it changes to null or empty string, I think, depends on whether in context empty string is a reasonable "zero value." Viz, will it fail gracefully automatically, the way an empty array would for "get list of things"? If so, empty string is probably better. If not, null is reasonable given the current state of the language. Null is arguably more purely correct, but empty string may be more ergonomic in practice. I defer to Nicolas who has probably had to deal with it more than I ever will. :-) [1] https://www.garfieldtech.com/blog/empty-return-values --Larry Garfield