Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113964 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 98547 invoked from network); 5 Apr 2021 19:53:03 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Apr 2021 19:53:03 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6EB531804DC for ; Mon, 5 Apr 2021 12:51:53 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail.webkr.de (mail.webkr.de [78.47.173.34]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 5 Apr 2021 12:51:52 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 074AA1A0F6C for ; Mon, 5 Apr 2021 21:51:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=webkr.de; s=dkim; t=1617652302; h=from:subject:date:message-id:to:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=6iGabWLfG6YiOd/EilD+uBCaiu1EQ8qfJ5d1/pQMZC8=; b=YlpiEskkTF45/03VUvitLvJrQeRaNjg0i4JXWe1krE8eyvk5q/T6MVV87yzug0LJfIoB3I fuoi3jyLq65FytzrvP6btQT2qE0bSYaZZo9CXREssW6ojYBT0eb2hHKf3BZde5r28sSn9x cUxReUjENCyqv55xU2BAZeVDjcAEnJM= To: "'PHP internals'" References: <0b8301d72a3a$71045ca0$530d15e0$@webkr.de> <55DEACD7-E0E8-45AD-84F2-A98D8AEEDC4D@newclarity.net> In-Reply-To: <55DEACD7-E0E8-45AD-84F2-A98D8AEEDC4D@newclarity.net> Date: Mon, 5 Apr 2021 21:51:35 +0200 Message-ID: <0ba001d72a55$187ab280$49701780$@webkr.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Thread-Index: AQHKWrWak77fogO0gqioCpMsnMdghwLopcgIAW2EqzCqnT3XAA== Content-Language: de X-Last-TLS-Session-Version: TLSv1 Subject: RE: [PHP-DEV] Raising the precedence of the new operator From: andre@webkr.de (=?utf-8?Q?Andr=C3=A9_H=C3=A4nsel?=) Mike Schinkel wrote: > I had asked Ben what he thought about allowing the following syntax as = a synonym for `new Foo()`: > > Foo::new() This can already be done in application code, having the language add a = synonym is IMO unnecessary magic and breaks the principle of the least surprise. The solution proposed in https://bugs.php.net/bug.php?id=3D70549 however = is very similar to what I'm asking. Note that in that bug entry the solution was based on the premise that = `$obj =3D new $foo->bar();` was valid code, which it isn't. (https://3v4l.org/lpN1T)