Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114984 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 36067 invoked from network); 21 Jun 2021 17:32:01 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 21 Jun 2021 17:32:01 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B0AE01804DA for ; Mon, 21 Jun 2021 10:50:04 -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=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) (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, 21 Jun 2021 10:50:04 -0700 (PDT) Received: by mail-qt1-f181.google.com with SMTP id c22so6498350qtn.1 for ; Mon, 21 Jun 2021 10:50:04 -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=moDkMjdJWWvoUVkuXFEuKBC0aUPe3ACQBgnBqJzpU/g=; b=lqyxVaqDdyYiVgJMdOzrZxKub/d3NwqKGZYHJRtiEC2ZQVC2J/CWg8xUHnPYcCsz2n XLvX3jaOygB20z1w7D/BpLaGaY/MytZCm48Xx8ZArmiNRne1GtMIu+cCiKw+wtb5UofH h0xfiasueMBewTLS2a0up37d+2PQGLFavRRTsf+Jc3ex6ahLW5ALfaisYJBY5U2mhdKr MCi80tfMIuW8cYcXaRLHqL4wSQKCQ2QDaqK9QvBXdPHHI0bC1b8Xvq31QAH+EJ2+WV8j ajoz7yoc9sFJ64mFg2TFZQh8FnJ4QEm10BBaXQsTcou1UxFOJoAXURTJDJyUTLEZjpB3 AxCg== 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=moDkMjdJWWvoUVkuXFEuKBC0aUPe3ACQBgnBqJzpU/g=; b=HYEEwXerwm24gf0dLlmAsEzeLS91CkToHWPM1VVgAIUSKAjkdfYcXpFT4RMJGfkQ90 BfIX9+B7uxjHaQiVR/f3EpUoYg1Eul05HskHV3kI/OJBBQDojQkXDPY3y05BUrgfiXhP pJh0lpHXuRuzr0pz+7ZVfFuO82eI9Z2ZG7dGhY77T4aI7JwZkrhtCCL3JKdo91cZO4r/ MopEV3yJJIbDlrVMQqrkuQTVPg7hrnXbL6FyNOvS53nNiboSBnJUQ/PwXY274nxkMh/X gutsjlx56c9C/oqXg5vrFCRLO6pbVjBmLX3ZEcDwODIawwP+Sp6hr8fXjbsLeAxOY0yX Xqfw== X-Gm-Message-State: AOAM5309yoGLw/IefhTsrWPnCuRJXsv89mE3rhfMp/O2NJlo7u1K26RY MbLeWZtjMjvjzpSwrkpbELGMhQYjAf9yiyXDLLE= X-Google-Smtp-Source: ABdhPJw+z37duVK5xCqB6glDenpjTyhLukC5HN1ey/quKvLwIis8DOkdtOL7mPyIGXml1dfLYf9O6hZ+CASfqGnXFk4= X-Received: by 2002:ac8:7c4d:: with SMTP id o13mr6114551qtv.365.1624297801702; Mon, 21 Jun 2021 10:50:01 -0700 (PDT) MIME-Version: 1.0 References: <7f2da982-e29b-ccca-bddc-24ae7f4b0390@gmail.com> In-Reply-To: <7f2da982-e29b-ccca-bddc-24ae7f4b0390@gmail.com> Date: Mon, 21 Jun 2021 18:49:51 +0100 Message-ID: To: Rowan Tommins Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000007adfe705c54a4d13" Subject: Re: [PHP-DEV] [PROPOSAL] Bare name array literals (again) From: tekiela246@gmail.com (Kamil Tekiela) --0000000000007adfe705c54a4d13 Content-Type: text/plain; charset="UTF-8" Hi Tyson, Interesting proposal, but I was going to reply with the exact same response as Rowan. Why not use DTOs for such purposes? Arrays have rather limited use cases. If you need to return multiple results from a function then you should return an object with typed properties. I don't like the idea of adding yet another syntax for creating arrays, especially one with limitations. If your array keys contain spaces or special characters then you need to use the current syntax. Adding to the fact that arrays have no type safety, I don't see much use for the newly proposed syntax. I would prefer an improved syntax for creation of anonymous objects. This is something which I have been annoyed with, myself.I'd like to see a simple way of creating anonymous objects with typed properties. Regards, Kamil --0000000000007adfe705c54a4d13--