Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123647 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 1C21C1A009C for ; Mon, 17 Jun 2024 12:54:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1718628960; bh=2EkZHN23pIGTG9sx+m6ItV0/mPrQur43YWSIfhNQExU=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=GC1qbgv82fBK+waGtOamixziUuGcwcIqnH3e7Ig5I/7fXWshmo3l86jkfbDkdQNh0 JKeFfJSFMz1s9VHnrv6xG3VEplvTLExK47aZRPGVZ7i20qYK6tA0vYBKkKmEK21qsP TTCYO38d52syxA9cTDzyhwJpdlJNcxMH+2wiBLAmL1u4UWR5/XA442YDztVvulIQFm /s6QDgJwICpX32F5ju6QQiZWEZCNUVp4QG2EqIs1vragGUgRdsBmugvWGNQF1DXUQ4 UMINdm+udhMccBQuzfZOWVNhttzihrV6EqmKLYZ/B/rKtNwu5nR9KV39C0rY292oj0 S6Fh7e9N5TXfg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0599B18005C for ; Mon, 17 Jun 2024 12:56:00 +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-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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, 17 Jun 2024 12:55:59 +0000 (UTC) Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-42179dafd6bso33109445e9.0 for ; Mon, 17 Jun 2024 05:54:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=scriptfusion-com.20230601.gappssmtp.com; s=20230601; t=1718628885; x=1719233685; darn=lists.php.net; h=in-reply-to:content-language:references:cc:to:from:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=8GFajSMQEClyTdYFPsQ2aNHScx+y+ONFopIfiHt6mDg=; b=ncD1L5C/G4vXb+EqNTd+v5zCblfI5B6Vc5d85fP1eNsgzlKFl1Ri8ymfQy/A8tu8yf ROCueFZG3XjrXWO72ooERkk/OuJGg5Cv6xfnqo9DOU8eE7Jpl1QKYNZxpz/rOZHahm6l cVbdCgf/wNkxtXpm8buxXQve0GGiIHPXYcFSpX//JKmPrWUlPyIvg4IE5A25AI80xrfS qp7fLp9nQf2fPX4KqjVTi1EJ/NBFjvMtQI+kxJdXVD2/uUhcfeBLaZM6Wp3pjGQA1s1o M91U+s/4Wp7DD2PyHzpuUxh+HjFZS2wd8FVZ+0YxdJD38KhzwS7wxMuXloMDtXMnghyD EV7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718628885; x=1719233685; h=in-reply-to:content-language:references:cc:to:from:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=8GFajSMQEClyTdYFPsQ2aNHScx+y+ONFopIfiHt6mDg=; b=Kvs4f4vJCHjQm+LkIEsdnCn2qivllEJdfutORWd/nv3eSMe3bzvL0lnCxm/6U4bfX2 Md25FOzuXt7l5+tiAfPrDzV0tEZrj2ROuT+i3YOCdH0OHM+Sgee8sxU6DNDzTuD11em0 5H9wj9Nc+2AKlhk1zmWBUyL0lx3cJG8/ifKR5K75K8emUgceDM9+ftVIncfWpnBETAE7 ha3PmYpkl4OF6IRhtnNqPuETdjWPtxbQoNDwjy62I01g2RTsgMbBq826mI31/2C1jlWo xD3sHdYexjx2EOF40G98rmqIp5pZ1GOImAG3RpRGyAQN5H95xymoNMO4gKaAc2n2Iggc pmvA== X-Gm-Message-State: AOJu0Yxh9Yzj+9rhWHVB+63Yn3c96dh/2/5EEoGt/sSKEUfoK3/0soRA nSYWJY+VYgpVY+l/6TI8TBxRCx6xmLq8/J1GGNT7Enxdq2HHS9VPyxChiP2bC1nI4ZxLRvJY9Vn zETw= X-Google-Smtp-Source: AGHT+IG8e60s0WeZAZnJLTwx6e5xcdgYCYrUjZDQoKWtz8Yd1m7POD0r+o95aIkziJCaeJ6FhMNx7A== X-Received: by 2002:a5d:6104:0:b0:35f:1e44:803b with SMTP id ffacd0b85a97d-3607190d7dcmr9439146f8f.35.1718628885186; Mon, 17 Jun 2024 05:54:45 -0700 (PDT) Received: from ?IPV6:2a01:4b00:bf09:5101:59f9:59da:99bf:b5e1? ([2a01:4b00:bf09:5101:59f9:59da:99bf:b5e1]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-360750f228asm11874460f8f.73.2024.06.17.05.54.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Jun 2024 05:54:44 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------ewGk01wnpiDAkhTpXkD17nAa" Message-ID: Date: Mon, 17 Jun 2024 13:54: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] Static class To: Mike Schinkel Cc: internals@lists.php.net References: <0cf69a14-f1b5-4077-9d91-d7b579485eec@scriptfusion.com> <936e1aa3-48cc-4552-9f68-676ebcdeb596@rwec.co.uk> <04ae10a2-ceae-4996-a7fe-9b38d2f81ca2@scriptfusion.com> <82601236-3228-491E-B776-457331B41C6B@newclarity.net> Content-Language: en-GB In-Reply-To: From: bilge@scriptfusion.com (Bilge) This is a multi-part message in MIME format. --------------ewGk01wnpiDAkhTpXkD17nAa Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 17/06/2024 13:49, Bilge wrote: > On 16/06/2024 14:32, Mike Schinkel wrote: >> >> Not supporting all features used in the wild would result in >> developers not being able to use static classes for new and/or >> refactored code if they believe they need those excluded >> features. This would stop developers from signaling their intent >> to readers of their code and would stop developers from being >> able to rely on reflection to discern static classes for new >> and/or refactored code when that otherwise could have been possible. >> >> Disabling existing features just for static classes would result >> in creating two forms of static classes — explicit and implicit — >> and that IMO would be a miss for the addition of static classes. >> > You wrote the perfect words. Even if I do not agree with all of your > six conclusions following, I agree with this preface 100%, to such an > extent that I think it should form the underpinning basis for all > further decisions on this RFC and be enshrined in the preamble of said > RFC, if indeed I ever acquire such permissions as are necessary to > actually write it. > > The idea of "implicit" versus "explicit" static classes is a clear and > powerful one that I think we can all understand, such that a > successful RFC would collapse this distinction; any failure to do so > would undermine the value of the feature entirely. As a concrete > example, then, prohibiting state in a static class is now completely > off the table simply because regular classes already support this > feature. Whilst some people have talked about idealogical aspirations > for this feature which sound valid in a vacuum, we must primarily > concern ourselves with the fact that this feature is being introduced > into an existing language, not a brand new language where such ideals > would have merit. And that is why this statement is so powerful: most > (but perhaps not all) of the answers to these disputed questions > follow naturally from the clear and guiding principle of this preface. > > Thank you so much, Mike, for this! I feel confident I can write this > RFC now, and with help from Lanre, we already have the beginnings of > an implementation, too! > > Cheers, > Bilge > Furthermore, for absolute clarity and the avoidance of doubt, I believe this guiding principle can be enshrined on the following single sentence:     "We cannot remove features from a static class that would otherwise be present in a standard class." I believe following this principle we will arrive at the best implementation of static classes. Cheers, Bilge --------------ewGk01wnpiDAkhTpXkD17nAa Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 17/06/2024 13:49, Bilge wrote:
On 16/06/2024 14:32, Mike Schinkel wrote:
Not supporting all features used in the wild would result in developers not being able to use static classes for new and/or refactored code if they believe they need those excluded features. This would stop developers from signaling their intent to readers of their code and would stop developers from being able to rely on reflection to discern static classes for new and/or refactored code when that otherwise could have been possible. 

Disabling existing features just for static classes would result in creating two forms of static classes — explicit and implicit — and that IMO would be a miss for the addition of static classes.  

You wrote the perfect words. Even if I do not agree with all of your six conclusions following, I agree with this preface 100%, to such an extent that I think it should form the underpinning basis for all further decisions on this RFC and be enshrined in the preamble of said RFC, if indeed I ever acquire such permissions as are necessary to actually write it.

The idea of "implicit" versus "explicit" static classes is a clear and powerful one that I think we can all understand, such that a successful RFC would collapse this distinction; any failure to do so would undermine the value of the feature entirely. As a concrete example, then, prohibiting state in a static class is now completely off the table simply because regular classes already support this feature. Whilst some people have talked about idealogical aspirations for this feature which sound valid in a vacuum, we must primarily concern ourselves with the fact that this feature is being introduced into an existing language, not a brand new language where such ideals would have merit. And that is why this statement is so powerful: most (but perhaps not all) of the answers to these disputed questions follow naturally from the clear and guiding principle of this preface.

Thank you so much, Mike, for this! I feel confident I can write this RFC now, and with help from Lanre, we already have the beginnings of an implementation, too!

Cheers,
Bilge

Furthermore, for absolute clarity and the avoidance of doubt, I believe this guiding principle can be enshrined on the following single sentence:

    "We cannot remove features from a static class that would otherwise be present in a standard class."

I believe following this principle we will arrive at the best implementation of static classes.

Cheers,
Bilge

--------------ewGk01wnpiDAkhTpXkD17nAa--