Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127752 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 420B71A00BC for ; Wed, 25 Jun 2025 13:09:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1750856859; bh=ROZWT/wYRJFkVU442UGg4Rd1LOFusDgnkTuGUDnp7tU=; h=Date:From:To:Subject:In-Reply-To:References:From; b=myg2nm/rF2iOc5TlHgSVwEIw+DebXsnPVMznwYQlX7R/DQ0ppyJXvNKxlY7Ozn+UO dlDtRzD/M9ssmdmiEf9MXIQ5aRKLcJgdtPQCwZaKH1eKiI4hKmYLuvzsanfbaQ9GpT xKeGMBlGoJenNH3wMPK3V5slGCY3oLLexwUJebNmy4PsL2976PYT0I9qB+zrly1IgX 9prJ2UTCAZ/L3n+Xi9fvGs7l5md3gLvDcGwUQKzrSzJv4t/XnIis73GRI3g7Uh+BXc iZ1KqP9QcltcDaw27sJtVg8KeM9H2lm4ZGAB75ntyJYYWTMyjnh9IH3hys6jl9FzHp aC4HTaNgOc7pA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2A098180549 for ; Wed, 25 Jun 2025 13:07:38 +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.4 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,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 fout-a7-smtp.messagingengine.com (fout-a7-smtp.messagingengine.com [103.168.172.150]) (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 13:07:37 +0000 (UTC) Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfout.phl.internal (Postfix) with ESMTP id C174BEC0292 for ; Wed, 25 Jun 2025 09:09:32 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Wed, 25 Jun 2025 09:09:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; 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=1750856972; x=1750943372; bh=x4D4dKX246P2TljltUQYiKUdMzR2wFyaWiwgUohEcZg=; b= INAVOkhzSseDOyij8Grbt7wpPmOqWXNefhWzIoJvqfYCbO8QP2zHkAt7oRsDjgn+ w+VAGPEpw+mf72IYlXr6C40dOeo3f82OiAOMGagU29JLNtsALLZ2JsTf6UTD0PwM AUVxATwuYn2vo2vr2lsTVBJdLfYRC2fgd28Bz1uSOtpa95OLOFxmPa5/gMC8mBTd 2g0zqBWr1benj7SvFIog9KgZwaFIO20oZJAcs9m7yNkMi43YmIfTH020tIgC2/so YJhplMfLsDoa4dfmXW4wuLO2VFVICDqJ50VFNUMEGLNYWUvViQ74RLlj+MlOFyT6 F1mR+I59WjKi1O9pf977Cg== 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=1750856972; x=1750943372; bh=x 4D4dKX246P2TljltUQYiKUdMzR2wFyaWiwgUohEcZg=; b=FUtmdFGnkLlotHeND RHh7b9JtK7a3pLn09VnQDUePyzqsGlkifxRD2sHJIf5cdkrtZ2k0mKOLF9K0jHNH FR/3+L8dC7aD6WmwgVCb2Z7OjyQ8XMRzdHqzXZcPYdsnm/L9DDNr6JruJKzGsKAw D8vCsGereAeldJY680WMzQg/ubSi8dn70xdTmrAdhMZRBmZOd8Xeh+NtPmEDaWRj /bVNWKC6DZApjG65KwvGyu4dzU4B2MCm+KLpGhi8G3Ev9UGu3bkKgDnqw+eZ8X16 pusZ3ghubFkD0+660G68J6eb3eI4xhHy6GAk94srBgf4Rukwz32VPfBy57Q46RKP w0yXA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddvgddvvdekhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecuogfuuhhsphgvtghtffhomhgrihhnucdlgeelmdenucfjug hrpeffhffvufgfjghfkfggtgfgsehtqhhmtddtreejnecuhfhrohhmpedftfhofigrnhcu vfhomhhmihhnshculgfkoffuohfrngdfuceoihhmshhophdrphhhphesrhifvggtrdgtoh druhhkqeenucggtffrrghtthgvrhhnpefhgeefudefgeduueelveeivdfhgfdvjeelvddt keeuledugeefjeehgeevvefhtdenucffohhmrghinhepfehvgehlrdhorhhgpdifhhgrth ifghdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhr ohhmpehimhhsohhprdhphhhpsehrfigvtgdrtghordhukhdpnhgspghrtghpthhtohepud dpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepihhnthgvrhhnrghlsheslhhishht shdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 25 Jun 2025 09:09:32 -0400 (EDT) Date: Wed, 25 Jun 2025 14:09:30 +0100 To: internals@lists.php.net Subject: =?US-ASCII?Q?Re=3A_=5BPHP-DEV=5D_Make_Reflection*=3A=3AgetDocComme?= =?US-ASCII?Q?nt=28=29_return_an_empty_string_instead_of_false?= User-Agent: K-9 Mail for Android In-Reply-To: References: <2108D675-AEF0-410B-9BD1-E68BFEBE4F9B@cschneid.com> Message-ID: Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 25 June 2025 13:21:22 BST, Andreas Hennings wro= te: >On Wed, 25 Jun 2025 at 13:56, Christian Schneider wrote: >> >> I noticed that the "empty string for absence of value" was also used in= DOMElement::getAttribute() but you can argue that the existence of DOMElem= ent::hasAttribute() fills this gap=2E > >I think all this shows is that different parts of php were created by >different people, or that somebody changed their mind over time=2E >To me, "return null" would be preferable for >DOMElement::getAttribute()=2E https://3v4l=2Eorg/QHXlA In that example, PHP shouldn't be deciding its own behaviour at all, it sh= ould be following the DOM standard=2E=20 It turns out, the specification explicitly states that the return value sh= ould be null in this case, so arguably it's a bug that PHP's implementation= does not: https://dom=2Espec=2Ewhatwg=2Eorg/#ref-for-dom-element-getattrib= ute%E2%91%A0 Rowan Tommins [IMSoP]