Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121736 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 37696 invoked from network); 20 Nov 2023 21:04:50 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Nov 2023 21:04:50 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DD63518002B for ; Mon, 20 Nov 2023 13:04:52 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_20,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.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (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, 20 Nov 2023 13:04:52 -0800 (PST) Received: by mail-lj1-f179.google.com with SMTP id 38308e7fff4ca-2c875207626so30137431fa.1 for ; Mon, 20 Nov 2023 13:04:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700514288; x=1701119088; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=cM9g4jkygULdWc80OQV4inonwPYNNGHokBU/eixcNJE=; b=DffFLgGc7rIGuo4kdYX2cFz8AJLOWNWLGDOTnW5uX3sy6KyQtNL9A/ah2+X37XG0M0 znXarz+QDUgzQ+tXFy71+JhCtgfek/qJpFAEp3UGORiFdHecA460B0VmjtnirzmG0HS3 eNQ0itQNOATzEuhSbc08nufztbBfLH2GksGIDkdWWWpCFiwOWtNB5y+FqNkGeW6shPb6 WJ/y2omZM6Slhz2tSYuj3z5vt7L6w7Uo53JOLFCJzSH9fgEsZ0PmRRXLgjYv9SLFFWYH seIDvM15rltiD78wLsINCxg4MVZMOLgZHC7ge8S8GHWFHsp6nB+2tiZYjktS6HYeBrLr 3DqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700514288; x=1701119088; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=cM9g4jkygULdWc80OQV4inonwPYNNGHokBU/eixcNJE=; b=b+jzlbTQyg69xuA5dtHaEhTsrDDTC2eseEDjn2FczaggERKYoeuVlbYDgKJNuZemtw dYcXh05n+Hm6d7aMlspFJSnRxC4esOOdnDoyN5gT+0TMnKVVhI25GOHzCTeWCMtrGG37 jQSaxk/uXyidl1J9zNFYIg5QHS3KOPwd7GiJEDEk7kVkLhLXjb13Gm6EohhbC6tryKpl ET1hsjoW/5RvAGKoepHysXr0e0zb+vRco2pAxSbzxJr1NSGZMzo8fl+WIfSeO7igegVt EEXCbqfGk482UpPP0X9m5RQKsVetV9/C8bSUuVF7ofnwBNP1/8FomgvEUDClw/d5VUDA GqhA== X-Gm-Message-State: AOJu0YzzCp8/JKgo/FBSgqUmlEVy5BPGBSCAiMojmjz458A7s63fD0cP 2xzS0kKiC39fU/D1ZRlDKjGbxYJzs83wFuww0EJ0s6AtGE/mzOx7 X-Google-Smtp-Source: AGHT+IGQK7dT8HHP8ub/KCOcu2bhPFi2HB4elekuW2GdpN13gxB+Gww7/zd3QQt8lmJGzPzH+ASoj0dyh92Y6o4nOoM= X-Received: by 2002:a2e:9e19:0:b0:2b6:fa3f:9230 with SMTP id e25-20020a2e9e19000000b002b6fa3f9230mr5694528ljk.46.1700514287566; Mon, 20 Nov 2023 13:04:47 -0800 (PST) MIME-Version: 1.0 References: <79d675e3-95b4-40bb-baf4-3e1c998f5390@online-presence.ca> In-Reply-To: <79d675e3-95b4-40bb-baf4-3e1c998f5390@online-presence.ca> Date: Mon, 20 Nov 2023 22:04:36 +0100 Message-ID: To: Lanre Waju Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary="0000000000000bc3b3060a9bd623" Subject: Re: [PHP-DEV] RFC Proposal - static modifier for classes From: jorg.sowa@gmail.com (Jorg Sowa) --0000000000000bc3b3060a9bd623 Content-Type: text/plain; charset="UTF-8" Hi Lanre, I like your idea and I was even thinking about proposing the same addition. The thing that is missing in the description is how the static class should handle magic methods. Should they be disabled for them? One plus of static classes which exist in other languages are that we wouldn't need the hack with private constructor to build Singleton. But... that's not the recommended pattern to use as explained by Larry. So I am not really sure whether it makes sense to add complexity to the PHP source code for such small benefit. Or maybe you see other benefits? I must also admit like others that your further arguments as below, are not good as someone after your implementation will need to maintain this code. > 1. I will personally implement this feature. > 2. This change is non-breaking and backward compatible. > 3. It is entirely opt-in. If you hold reservations about using static classes, you can simply choose not to use them. Kind regards, Jorg --0000000000000bc3b3060a9bd623--