Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123185 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 B64761A009C for ; Tue, 23 Apr 2024 13:55:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1713880555; bh=WEKbQ9YHktOKZ2IvOYcFW02ho4rT/rRmiQuD7x0P6E0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=QLQ4yatCBDzHZPSPf/MhjdhHs0QCH4auE8dDf1Q5W1NLdlUtRC+KsriTogCuUG0Qc WRCIWdtSafksA/WV0EJLcYjDLvWzGSy/RCNCQSPmkpQnCOI9AE4Lu3LYCEqWYFEFr0 cWEOrtVUD7nTpMgbPBqUyc2QUS0a6/SeuRzxNvdDxQREY9Oya6mzFl/2j8bbBK/NVC BIJlNHJPTuGdKeMovtNPsbllHBFgC9YGQY1hAEfFA+5MeZtYA/iI+XUe1Xl2hs7u3j Ziy7IFK6wUuB0sMsPH4cAxZmAvIxVjoQBrOYJ6eCv+i1KJfK5rkxtMvKHbS3W4vHVv SkV3FMqFLvhew== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AAFC51805BF for ; Tue, 23 Apr 2024 13:55:54 +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.6 required=5.0 tests=BAYES_50,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,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-yb1-f181.google.com (mail-yb1-f181.google.com [209.85.219.181]) (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 ; Tue, 23 Apr 2024 13:55:51 +0000 (UTC) Received: by mail-yb1-f181.google.com with SMTP id 3f1490d57ef6-dc742543119so5580213276.0 for ; Tue, 23 Apr 2024 06:55:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713880510; x=1714485310; 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=WEKbQ9YHktOKZ2IvOYcFW02ho4rT/rRmiQuD7x0P6E0=; b=AD/Y+EWKwxcEydFNz0mVGozocLmLXCOViVsK3Vuqlj1DAyDZSofrybXON4ilHSGu/Z 4ctpOtRzEjxBG62kD+KIhlVNLarsRO/6SRbvEaOUL0n2OdZ/HcaxGxnwdjeg3Uw9bkmi fqd2YqjYeBQ/yrhrLxrt2upYut4Et3mdTRqpm+C6vD31ZJZWGNN/mJC12SSTALzsYLSm SttKGscnOBgd3lz0K51jDqzQm/ZpC7Dowai3VpC6AIp8Xhn5ais6OrXzAGIO8as3S+DX qxGlzyvpvBC9+weItmvParPUbcYR20T5Jo99UgDaE5dAq/H0Hu/Xdt07X8zhDGV0Y3Ud cTiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713880510; x=1714485310; 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=WEKbQ9YHktOKZ2IvOYcFW02ho4rT/rRmiQuD7x0P6E0=; b=ZVFxTHROgAzLuumTaOoVlR3ffyNZwnQqYNHRovP0efOwzX+z/q0P0th82ajKYnM2EK ZSvkC8Pz0U6Zo3KPdNH6dnzLMNx7wPKXD4wWK3RhNVhWhJmF7CKGcWFuglVcM/7taDFm 8aEYTGu/2CEMWmg/YCzpc+WrgyfRaQHkT92nVBRODCk38btMgVPls10E4UzyVI/QM3d2 j3xqW7iUU78qpshq5LQJ+Azl/uGOve/Z+aBfydiECDdsGUVFAKY0zTzA6m5oxK0YsQVS TicAkuRYOBzY8kdiDhYfAgZugl4k+1G3lbRUY7BP8pZpOs140J7COysfoEw6DQpoi9MX 5Aug== X-Forwarded-Encrypted: i=1; AJvYcCWtf5VN54FZIzqS3Y8+tPk7/pE2RsuSfZn5MWb6CANyFnj28ZRe0vFC1dAMfvd1H2g3eZEut0FUfOFMEAUZhLrE7p3Tubt7Iw== X-Gm-Message-State: AOJu0Yws6LZM+i4HPc9NMsAl9HEzoMK5LlmRolwjUve5ROs3PFeoVe8l aO5Lxh1SjvLxNmEYdWls8XfEDuNH3Ph+GcEQR6+U4EtR7+HnxHy2CjIwVQ35lx61tqRJSrPKlbR Sbg0ilMnI6o2l/Q5+Y6vHUeaxk48= X-Google-Smtp-Source: AGHT+IHk8mdf11ks2HRwqyxhsYrY+7WO+evTYPqkoUl5cL5xlHzC5TgPfNTQ5BsXWowpLII4bgduWdbWlYXOzckJJwg= X-Received: by 2002:a25:b126:0:b0:dcf:b5b7:c72 with SMTP id g38-20020a25b126000000b00dcfb5b70c72mr11508540ybj.0.1713880510154; Tue, 23 Apr 2024 06:55:10 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 References: <0466054f-bbec-47fd-8452-e848ebec7ec9@app.fastmail.com> In-Reply-To: Date: Tue, 23 Apr 2024 16:54:52 +0300 Message-ID: Subject: Re: [PHP-DEV] [RFC] [Discussion] new MyClass()->method() without parentheses To: Robert Landers Cc: Valentin Udaltsov , Larry Garfield , php internals Content-Type: multipart/alternative; boundary="000000000000fed0cc0616c3e6b7" From: drealecs@gmail.com (=?UTF-8?Q?Alexandru_P=C4=83tr=C4=83nescu?=) --000000000000fed0cc0616c3e6b7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Apr 23, 2024 at 3:31=E2=80=AFPM Robert Landers wrote: > On Tue, Apr 23, 2024 at 11:10=E2=80=AFAM Valentin Udaltsov > wrote: > > > > > > Does anyone have additional feedback? I'd like to start voting on > Thursday, April 25th. > > I've also added a section on other syntax ideas that have been expresse= d > on Twitter and in the PR: > https://wiki.php.net/rfc/new_without_parentheses#other_syntax_ideas > > -- > > Valentin > > I suspect this will break (badly written) reflection in interesting ways: > > https://3v4l.org/mcSNH > > This basically breaks dereferencing order of operations and makes it > inconsistent. > Quote from RFC: "RFC still does not allow to omit parentheses around the new expression *without* constructor arguments' parentheses, because in some cases this leads to an ambiguity" And actually it mentions a list in the RFC: // Instantiate and then access the instance or instantiate the result of the expression?new MyClass::CONSTANT ;new MyClass::$staticProperty;new $myClass::CONSTANT ;new $myClass::$staticProperty;new $myClass->property;new $myClass->method(); But actually from all of those, right now, only "new MyClass::CONSTANT ;" and "*new* $myClass::CONSTANT ;" are not working, while the other 4 are working fine. So yeah, this needs clarification if they continue to work as they work right now: https://3v4l.org/PmCfR Thanks, Alex --000000000000fed0cc0616c3e6b7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Tue, Apr 23= , 2024 at 3:31=E2=80=AFPM Robert Landers <landers.robert@gmail.com> wrote:
On Tue, = Apr 23, 2024 at 11:10=E2=80=AFAM Valentin Udaltsov
<udalts= ov.valentin@gmail.com> wrote:
>
>
> Does anyone have additional feedback? I'd like to start voting on = Thursday, April 25th.
> I've also added a section on other syntax ideas that have been exp= ressed on Twitter and in the PR: = https://wiki.php.net/rfc/new_without_parentheses#other_syntax_ideas
> --
> Valentin

I suspect this will break (badly written) reflection in interesting ways:
htt= ps://3v4l.org/mcSNH

This basically breaks dereferencing order of operations and makes it
inconsistent.

Quote from RFC:
"RFC= =C2=A0still does not allow to omit parentheses around the=C2=A0new=C2=A0expression=C2= =A0without=C2=A0constructor argu= ments' parentheses, because in some cases this leads to an ambiguity&qu= ot;

=
And actually it mentions a list in the RFC= :
// Instantiate and then access the instance or instan=
tiate the result of the expression?
new MyClass::CONSTANT;
new MyClass::$staticProperty;
new $myClass::CONSTANT;
new $myClass::$staticProperty;
new $myClass->property;=

new $myClass->method();
But actually from all of= those, right now, only=C2=A0"new MyClass::<= a href=3D"http://www.php.net/constant" class=3D"gmail-keychainify-checked" = style=3D"font-family:"Source Code Pro","Courier New",Co= urier,monospace,sans-serif;color:rgb(51,102,153);border-bottom:1px solid;te= xt-decoration-line:none">CONSTANT;"=C2=A0and "new $myClas= s::CONSTANT;" are not working, whi= le the other=C2=A04 are working fine.

So yeah, this needs clarification if they contin= ue to work as they work right now:

Thanks,
Alex
--000000000000fed0cc0616c3e6b7--