On Fri, Nov 24, 2023 at 2:30 PM Deleu wrote:
>>
>> Hey Mike,
>>
>> Using a static method to enforce LSP when it should have been enforced
>> in the first place, merely proves my point that it violates LSP. I
>> don't know how else to spell it out, I guess we can try this one next:
>>
>> class A {
>
> Hey Mike,
>
> Using a static method to enforce LSP when it should have been enforced
> in the first place, merely proves my point that it violates LSP. I
> don't know how else to spell it out, I guess we can try this one next:
>
> class A {
> final public static function foo() {
>
Hi Robert,
Am 23.11.23 um 21:31 schrieb Robert Landers:
However, we can make certain methods private anyway, namely,
constructors (I haven't gone hunting for other built-in methods yet).
This is perfectly allowed:
class P {
public function __construct($name = 'waldo') {
echo
On Fri, Nov 24, 2023 at 12:46 PM Mark Trapp wrote:
>
> On Thu, Nov 23, 2023 at 12:31 Robert Landers wrote:
> >
> > Hello Internals,
> >
> > As you may know, an inherited method cannot reduce the visibility of
> > an overridden method. For example, this results in a fatal error
> > during
On Thu, Nov 23, 2023 at 12:31 Robert Landers wrote:
>
> Hello Internals,
>
> As you may know, an inherited method cannot reduce the visibility of
> an overridden method. For example, this results in a fatal error
> during compilation:
>
> class P {
> public function hello($name =3D 'world') {
On Thu, Nov 23, 2023 at 12:31 PM Robert Landers
wrote:
>
> Hello Internals,
>
> As you may know, an inherited method cannot reduce the visibility of
> an overridden method. For example, this results in a fatal error
> during compilation:
>
> class P {
> public function hello($name = 'world')
On Fri, Nov 24, 2023 at 5:06 AM Mike Schinkel wrote:
>
>
>
> On Nov 23, 2023, at 4:50 PM, Robert Landers wrote:
>
> On Thu, Nov 23, 2023 at 10:30 PM Deleu wrote:
>
>
> Constructors are an implementation detail of a specialized class and as such
> they're not subject to LSP because the goal of
> On Nov 23, 2023, at 4:50 PM, Robert Landers wrote:
>
> On Thu, Nov 23, 2023 at 10:30 PM Deleu wrote:
>>
>> Constructors are an implementation detail of a specialized class and as such
>> they're not subject to LSP because the goal of LSP is to be able to make
>> sure that any object of a
On Thu, Nov 23, 2023 at 10:30 PM Deleu wrote:
>
>
>
> On Thu, Nov 23, 2023 at 5:31 PM Robert Landers
> wrote:
>>
>> Hello Internals,
>>
>> As you may know, an inherited method cannot reduce the visibility of
>> an overridden method. For example, this results in a fatal error
>> during
On Thu, Nov 23, 2023 at 5:31 PM Robert Landers
wrote:
> Hello Internals,
>
> As you may know, an inherited method cannot reduce the visibility of
> an overridden method. For example, this results in a fatal error
> during compilation:
>
> class P {
> public function hello($name = 'world') {
On 23 November 2023 20:31:09 GMT, Robert Landers
wrote:
>I'd like to propose an RFC to enforce the covariance of constructors
>(just like is done for other methods), to take effect in PHP 9, with a
>deprecation notice in 8.3.x.
There's a lot more than visibility that is enforced on normal
Hello Internals,
As you may know, an inherited method cannot reduce the visibility of
an overridden method. For example, this results in a fatal error
during compilation:
class P {
public function hello($name = 'world') {
echo "hello $name\n";
}
}
class C extends P {
private
12 matches
Mail list logo