Newsgroups: php.internals,php.internals Path: news.php.net Xref: news.php.net php.internals:128432 php.internals:128433 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 DC60F1A00BD for ; Fri, 8 Aug 2025 07:13:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1754637104; bh=ltID24V+WeQnA+/llr47E6RSB4/SKzpRARjmJdb4uN4=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=DGdyLLI0JCVjjQ8jiKz4rvnSTExU6Nkqs0X3HuWZSvHaTD0taEoFPqOFWAiX3VFHo yn5qlRsjm3XxIMTV/4FEyUM1IyWSEhwzBN1kDdvk9+MX7f+JC9vjIDp28JV8Wipw3h vco6IEoeMtXtIbwH+oZNC69//L/HkuOzWD1qU44/M6LoMHF/Gon7hQXMKtOJSZu8/f S459poPHPixsS9aScNprxoVGbu35Ua6MGSJrFVlp1Xs/65FgBOncqKQ/4rvaD5RG0+ qI/J5J30EASsdORDOt+OMX7kQibUln6OzFzBKTYIemAb10j6p9EDsjjSJRuEOIs6GG hidSl/484hztg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CB11C180050 for ; Fri, 8 Aug 2025 07:11:43 +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=-0.4 required=5.0 tests=BAYES_50,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: No X-Envelope-From: Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (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 ; Fri, 8 Aug 2025 07:11:43 +0000 (UTC) Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-3b78a034f17so1485559f8f.2 for ; Fri, 08 Aug 2025 00:13:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754637201; x=1755242001; 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=pYD/aAhUnVeRsxGwnz2+0jMti8+DafPfLNrnUzQr1OY=; b=AKE1jS+tfRtvaH/Jgn9gga9eg9r3neVYt+vPXSoMsOuETBWpPtO+69pUYQmCKmOtuj zOlrmHq4m2SV9t39AYcUqEJae5+f2pXKXIMoM7knMWTgoq5w4+6sxgax0PklbSJcuiQ1 m3P974xyaMk0UWa2UH6tA9lWf62wIbJFyKcUQK4ichwPRk4VwVFGEseFkg3/ImKI/cmP seohRi79EJrVdurmlqMX+kDRjCiSQe2FTJ0A/LvnmGYKnoKs4hgxsJ3Nsc1JvWcgY0vK 7IfuC2nF9ei1kJHentoQDmPWXPd9k+5qgdJACV99v6wE/naGfs2p8YzZby+LI+k+hmY7 JIgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754637201; x=1755242001; 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=pYD/aAhUnVeRsxGwnz2+0jMti8+DafPfLNrnUzQr1OY=; b=JV/AKP0+SFrwun1Zgq41i/ZoTXLRCKV9dFyaC9dfl1Hs6fd+hy30CLlVXfNBSG+OHC e1xS2VyxArCStHgoYeGAoBHJ3xeI61X1KWP3KzoWj8KmXa3xausL4Z6I2C5eAGGFMm8I ht5AjRm5d+yU7FBZcmcGHH4cJylUMc3K9M9SKa5UloIG2Pa2SuIeLVT//7oPvlVk+0vQ gcN3QRtTu1c+Dpc00eFo98PrzJ9O4aNR8xUTruUz88NTQIotaAfX5+RdpfNZsPbg5UxE UwXYX/nsfgScUTH3XaW2SCw8jeSzusEA8+rHTFLRN40/1icOM985z91pJK2mNiCzIgfy x2YA== X-Forwarded-Encrypted: i=1; AJvYcCU3dDKCZOgANk8jOHyxw+2MStM6RhwJHTYnuyV8ODS43SLtLmBBQWdPzysdKveGD2+pnTgplTaQD20=@lists.php.net X-Gm-Message-State: AOJu0YxGdnQfjUCX2PORXRkqAMmr175hKs4AIuQbTqPPMIKTnvEKzHUO a8aCnaWUp0TrfS6XxT+xinP/lWy5qORGwg5z7Gy8J0Y2bdXBIDrFMdBl X-Gm-Gg: ASbGncsZg6ltaT1a/rIMLm07KR/1wCmkVKLs5VMlua00YmJof17dIZEgOIqK+i+Y7fX E4lTQ+isQtFunGF8EoQU+5w1bFmCAmKgPeWtSKiyTNjF3t9FnhZpyDOLrroeN0jfP9yM1nmswqm RIhzpCyzhXvCP5jU6N0KpXx971thlyn1zQZ0djQAQvSBgBs9b3011Mjc86UfqCMY8znZut34Wz2 0NTqYaAlWmxj+YnhXpqshQl67aAd+5AiX4EYML0ztChtsbLsYM+vcPBgLr+AmEv2hQ9Fbe4LP4K wja5VqoayHiFLAOtmsuq720es0tL1y9c2B/AG9HX0OO5EAso0GFSstXkI+ZHUM99OaftQRUD/pe xuDfi6PEm65I2k7ACOm9DlNbwFEAqiz+u6YFoXN1Ivwll9Y2+qlmRzKfD X-Google-Smtp-Source: AGHT+IGbHmHlB01EaxJrPToDil2wOHRlKN5rEmxnQ1fN/kh97r6USc3V+WJiEGpLDThowqlVWhQg0w== X-Received: by 2002:a05:6000:188e:b0:3b8:d3ae:26e with SMTP id ffacd0b85a97d-3b900b83cefmr1473917f8f.53.1754637201037; Fri, 08 Aug 2025 00:13:21 -0700 (PDT) Received: from smtpclient.apple ([89.249.45.14]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-458bb04c612sm245242575e9.0.2025.08.08.00.13.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Aug 2025 00:13:20 -0700 (PDT) Message-ID: Content-Type: multipart/alternative; boundary="Apple-Mail=_69005777-6584-4C7A-A37E-716081619D5E" Precedence: list list-help: list-post: List-Id: x-ms-reactions: disallow Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: [PHP-DEV] Protected inheritance hierarchies Date: Fri, 8 Aug 2025 09:13:09 +0200 In-Reply-To: Cc: Hans Krentel , internals@lists.php.net To: Jonathan Vollebregt References: <1754480697189.440122623.4156562731@yahoo.de> X-Mailer: Apple Mail (2.3826.700.81) From: claude.pache@gmail.com (Claude Pache) --Apple-Mail=_69005777-6584-4C7A-A37E-716081619D5E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > Le 7 ao=C3=BBt 2025 =C3=A0 20:37, Jonathan Vollebregt = a =C3=A9crit : >=20 >=20 > Back to the original issue: I'm going to open a github issue on this = since it's clearly a bug and I don't see fixing it breaking any existing = code. Hi, Sorry to reply without completely reading this long thread. As many of us understand it, the application of Liskov Substitution = Principle indeed shows that, if you can access a member declared in a = given class from a given context, you ought also be able to access the = same member when it is redeclared in a subclass. This is true whether the member is concretly a method, a property or a = constant, or whether it is static or not. I am writing this to draw the attention that the issue should be = resolved not only for protected properties, but also for protected = constants. Test cases currently passed: protected method: https://3v4l.org/LmLLu protected static method: https://3v4l.org/vjllN Test cases currently in failure: protected property: https://3v4l.org/br0tj protected static property: https://3v4l.org/2Ue97 protected constant: https://3v4l.org/jXm6U =E2=80=94Claude= --Apple-Mail=_69005777-6584-4C7A-A37E-716081619D5E Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

Le 7 ao=C3=BBt 2025 =C3=A0 20:37, Jonathan Vollebregt = <jnv@jnvsor.net> a =C3=A9crit :


Back to = the original issue: I'm going to open a github issue on this since it's = clearly a bug and I don't see fixing it breaking any existing = code.


Hi,

Sorry to reply without completely reading this long = thread.

As many of us understand it, the = application of Liskov Substitution Principle indeed shows that, if you = can access a member declared in a given class from a given context, you = ought also be able to access the same member when it is redeclared in a = subclass.

This is true whether the member is = concretly a method, a property or a constant, or whether it is static or = not.

I am writing this to draw the attention = that the issue should be resolved not only for protected properties, but = also for protected constants.

Test cases = currently passed:

protected method: = https://3v4l.org/LmLLu
protected static method: = https://3v4l.org/vjllN

Test cases currently in = failure:

protected property: = https://3v4l.org/br0tj
protected static property: = https://3v4l.org/2Ue97
protected constant: https://3v4l.org/jXm6U

=E2=80=94Claude
= --Apple-Mail=_69005777-6584-4C7A-A37E-716081619D5E--