Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124288 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 qa.php.net (Postfix) with ESMTPS id 6ED7C1A009C for ; Mon, 8 Jul 2024 12:22:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1720441455; bh=CrsuopUwTIsW8Mc7D3ioAjCeScZlrBi3DBFO1TpeYZo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=BdHJjRSG/6BCUbiJGTuhLPVyhAZWIufyebOioaX/tzbjdIY6KsRU+apAKLb6CnJCc gXC1qfh4dX8oPgYQKmXXN3PplqSiqLWxGK8UE9PlM8UJDmCz5+dyGY6I/kWia5wXl4 2TUNEnkzfWqxDMMeDRoUsjgnLBClNWCBj7022Ja0JTIiIFovQp3y/1fy43+ZDow+ZO eelE2JB2UYqYq9H81iaRNK84GgeuJewlBzYGD8O0D3bn5YU5/rtdo9DJSFM++V88Ip kMSMfCx5B/tRNhywz6FIsUhjaupxtw6BCMSu7mErKItHvXnYx6C+AKjrsvlfbx0lv5 zzIKHBgk8EkAQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 781A0180977 for ; Mon, 8 Jul 2024 12:24:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DMARC_MISSING,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 ; Mon, 8 Jul 2024 12:24:14 +0000 (UTC) Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4257d5fc9b7so33174125e9.2 for ; Mon, 08 Jul 2024 05:22:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=scriptfusion-com.20230601.gappssmtp.com; s=20230601; t=1720441368; x=1721046168; darn=lists.php.net; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=0AsQRx+AqsKJwI+a4TP5Z9mpx9l6aIoKTLhvQo8oOYk=; b=bQTPTcly9vxqZWvvD2okRr19SVn8qUloBmMaU/FfTxh2BGDySYSC3bGnUdSqMbcMTv CdIDxdAxYPT/v5+u64twjmxA9S6lQsFZ74Kwm4noSFJ58/Xu9lTwn5nBHWZ4Wrc68Zv2 O5tPz1HQe8mCrFp08h8icBhFR8nbqErirWxmwVdQZkfVYlDIvBe54XX+bn7/0Mj5ytNn UzrJ46esVXc5WNqXPfPHoowVA49SsOpT2XfVA6OFxeGXPgYadFq4nAGbZ90KNRVCoPOb Qtl30UvzdXVDOjjzMiPVFwKOhELEcWXQKG2uu8Jue+iSr3X0X+6x1M+akQNNIml/mLWp EdEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720441368; x=1721046168; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=0AsQRx+AqsKJwI+a4TP5Z9mpx9l6aIoKTLhvQo8oOYk=; b=bCQaqDr2wNT28xxP/4VVSswGG3VCqyi8CCSktZGIphHV/PggaPrPRy3jRk6+qrEsej iK5zLKGnY/j1CGwGfqr8NEAneqqmOvIO5Kgt5yzPxz6Gb4a9PtuPmypcO4VBqzlWST/z kfARaxI/UrgARIkbCLJwNb7LOEXTdncfqw0gxjIJAWPMsw9kdHdbc8Oz3Zhb/gJK7DVw 11hL3V5fPV3zUZUlQR5TqAFMYY9dXPx4nF349Uivdxiq4CzzXj63OBQ3/dRK3Fvrtw6E iHA+QbwUPalC0RBiRpd5CXSUI8PaDGakAyrrWto9F1de2hde3xICrcQIOPntkCZTjih6 DciQ== X-Forwarded-Encrypted: i=1; AJvYcCWoEM1J7PGNoPmt0BukFo3oo+IbKnx8I3Lx2MMkM/Ll5rMvxxNSjF89Edbgib6IKac0RrzcH5mjQdKuQqvzfeHPjuUJe2bZFQ== X-Gm-Message-State: AOJu0YxgvynC8beYdApOgc8UkhJVy7pivPkexpcadwUzvovY6EpcNLFm 1qWMSk2oy8psaGz8ACt/TQRATwYYml+E4pUfk0UW3/MVJ+FJkm72GxEbMv7nI3o= X-Google-Smtp-Source: AGHT+IEsaFyEax1dJSAQVzoz6b8Hbz2zSwPSavq/44tFt79g2T8aKhsqaBJmlfMAmFYRw8cyz9hLRg== X-Received: by 2002:a05:600c:434b:b0:426:5f37:6fc4 with SMTP id 5b1f17b1804b1-4265f376feamr44779405e9.40.1720441368096; Mon, 08 Jul 2024 05:22:48 -0700 (PDT) Received: from ?IPV6:2a01:4b00:bf09:5101:a1fd:b0c7:e213:ca6f? ([2a01:4b00:bf09:5101:a1fd:b0c7:e213:ca6f]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-4265e9de12fsm92788425e9.6.2024.07.08.05.21.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Jul 2024 05:22:10 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------EOO6NMuP1L9UQHN8GDGz22jl" Message-ID: <30320e4c-aa99-4fb6-b475-d21f5fe85a26@scriptfusion.com> Date: Mon, 8 Jul 2024 13:21:44 +0100 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] [RFC] Static class To: =?UTF-8?Q?Alexandru_P=C4=83tr=C4=83nescu?= , Stephen Reay Cc: Mike Schinkel , php internals References: <743774dd-2281-458d-b0fa-d3e8806a3516@scriptfusion.com> <3B6AF286-642C-4850-9577-B10049CE4C1E@koalephant.com> Content-Language: en-GB In-Reply-To: From: bilge@scriptfusion.com (Bilge) This is a multi-part message in MIME format. --------------EOO6NMuP1L9UQHN8GDGz22jl Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 08/07/2024 12:48, Alexandru Pătrănescu wrote: > > On Mon, Jul 8, 2024 at 1:12 PM Stephen Reay > wrote: > > > > So really the question should be: why do you feel the need to > *disallow* a combination that has no technical issues, and works > already? If you're going to disallow abstract why not disallow any > class inheritance at all? Because that's what abstract relates to: > class hierarchy. Why remove some support but keep the rest? > The reason to remove abstract was because it was thought `static` means the same as `abstract`. That is, neither can be instantiated. However, clearly that is short-sighted as Alex's example proves. That is, we cannot simply replace `abstract` with `static` because that precludes us from having an incomplete definition where some methods are still not yet implemented. As such, I am quite convinced by your arguments, and will make the change to add `abstract` support back in; mainly because removing abstract support defies our fundamental razor (it's something we can already do). > > If we support inheritance for static classes, we should allow static > on both interface and abstract classes. > What do you mean by /allow static on [...] interface/? Are you saying you also expect to see `static interface` support? (This is something I am absolutely not considering at this time, without a very good argument in favour of). Cheers, Bilge --------------EOO6NMuP1L9UQHN8GDGz22jl Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 08/07/2024 12:48, Alexandru Pătrănescu wrote:

On Mon, Jul 8, 2024 at 1:12 PM Stephen Reay <php-lists@koalephant.com> wrote:


So really the question should be: why do you feel the need to *disallow* a combination that has no technical issues, and works already? If you're going to disallow abstract why not disallow any class inheritance at all? Because that's what abstract relates to: class hierarchy. Why remove some support but keep the rest?

The reason to remove abstract was because it was thought `static` means the same as `abstract`. That is, neither can be instantiated. However, clearly that is short-sighted as Alex's example proves. That is, we cannot simply replace `abstract` with `static` because that precludes us from having an incomplete definition where some methods are still not yet implemented. As such, I am quite convinced by your arguments, and will make the change to add `abstract` support back in; mainly because removing abstract support defies our fundamental razor (it's something we can already do).

If we support inheritance for static classes, we should allow static on both interface and abstract classes.

What do you mean by allow static on [...] interface? Are you saying you also expect to see `static interface` support? (This is something I am absolutely not considering at this time, without a very good argument in favour of).

Cheers,
Bilge

--------------EOO6NMuP1L9UQHN8GDGz22jl--