Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107070 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 72144 invoked from network); 13 Sep 2019 12:03:31 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 13 Sep 2019 12:03:31 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id 8A4B82D1FBB for ; Fri, 13 Sep 2019 02:39:38 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp3.php.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Virus: No Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp3.php.net (Postfix) with ESMTPS for ; Fri, 13 Sep 2019 02:39:38 -0700 (PDT) Received: by mail-ot1-x330.google.com with SMTP id 21so28803986otj.11 for ; Fri, 13 Sep 2019 02:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wrp50DFl5mgiM5zis7F7f4N3q+XgPtzHhuUs9qrook8=; b=AmbMlcfaMyFdXQs3Sl7kVpbqurYwiu7O/otRcbuPFfYYNfSwMeHwPpmyBVuM0Cmu9O mC6OEaY2zRNt8iQeL2+wF1+DOznR0Qma4CROzWpTPTtdcafDbJhp9zNrameCrOKXIbzw 6EBFd8RbjfuFwS7yPEo5yVRqQg0dc149R4Dy5fdWjVcN/+5fMTRuG7YtE52tHQwhDdcB Jh6Y3CYIotD+OjBHD+21rnGRIPF8CC9NPbPaUAnLMmnkteY8Aw4l+/ZNRbHyTwajmkGI x7jtJCsRqNRLGknnStusH7pGglkdZiR9K8Kzf3edPMR3i7/QcAR0FMoHf1qFghgA24Yj KTbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wrp50DFl5mgiM5zis7F7f4N3q+XgPtzHhuUs9qrook8=; b=V+sZ+VFcYDoHDxl64TJqUgSlEKnN3qMuaEmVpHnCn4I5E3uvXpIuOdLgfud5tpIza9 J/OMCuZgdxmT447siKrmg8g6GFVN4MlD64nG5/uEbioberNS7ELO/sbrHQ699t6kZ49G nU7Sc0uJ1sar0XOgZbz61o6bI5sgdbrwaKI0r5EL0z7jSRNxuE5LAefsYWk8IcASBs+j xnRtEOwt+j92XAphXEJbeO+SP31NHrjkb2WT3cOdm/Ho08cd7b0Lerm4I+DItT8Lxdep BOX0UpXkKUDGbsAdOlWRYHzhWoqDxGRw/i9j13PcaaxNiihfa+ZlTFuYr82fe8aT+GLO cJHQ== X-Gm-Message-State: APjAAAUihREbipfLn3fE/WgcQ07gUDqQkCySaeghgd3tpBhymeFzw8su TjiS5jr9CYwnLR6ETeogDUG2NZsxAznMwzRPcBI= X-Google-Smtp-Source: APXvYqybpppA2XJDwSxnbpUSQJs4wviViD4nLnTQWUg0dGVW9CkJryNPbe1/yIqKG55hypXbcQhVw2pKmmz0OxKVj2s= X-Received: by 2002:a05:6830:128b:: with SMTP id z11mr2097531otp.79.1568367577357; Fri, 13 Sep 2019 02:39:37 -0700 (PDT) MIME-Version: 1.0 References: <74C03BB1-28DF-4694-A91D-2516C545F8B2@gmail.com> <3CA484B0-BCA3-4A2B-B2A6-8B845F9C462B@newclarity.net> <2CA1F9C5-AC54-4E45-AE9E-20BB32BD7093@newclarity.net> In-Reply-To: Date: Fri, 13 Sep 2019 11:39:25 +0200 Message-ID: To: Mike Schinkel Cc: Arnold Daniels , PHP Internals Content-Type: multipart/alternative; boundary="00000000000053607505926c0894" X-Envelope-From: Subject: Re: [PHP-DEV] [RFC] Object Initializer From: michal.brzuchalski@gmail.com (=?UTF-8?Q?Micha=C5=82_Brzuchalski?=) --00000000000053607505926c0894 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable pt., 13 wrz 2019 o 11:29 Mike Schinkel napisa=C5=82(a= ): > IMO should stay specific for arrays only. > > > Why? Is there an objective reason? > > $obj->foo =3D> 123; Simply, that's not the way you initialize object property values. When you use "=3D>" in array context you're pushing a new value to array an= d it'll work without labelling it with key where the key could be number index or string index in what shape you want (whitespaces etc.). > Is there some aspect of the syntax that makes it appropriate for arrays > but inappropriate for object initialization? > > > These are honest question. > > > My two cents: I would like to type less too, but I have always assumed > that "=3D>" was the PHP-ish syntax for initialization of a structure so i= t > seems very appropriate to use for object initialization too. > > > That said, > > > 1. I don't feel strongly about iti either way, > > 2. Unless using "=3D>" would make naked object initialization possible = =E2=80=94 > i.e. { foo =3D> 10 } =E2=80=94 given that it seems, as Arnold said, this = would > conflict with other meanings: { foo =3D 10 } > > > { $foo =3D 123 }; // unexpected "}" cause of missing ";" $bar =3D { $foo =3D 123 }; // unexpected "{" cause it's not allowed in this context Both examples are syntax error. You can use {} for separating blocks of code, but now if you wanna assign value. Everything considered syntax error can be used for feature shaping. Regards, Micha=C5=82 Brzuchalski --00000000000053607505926c0894--