Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114574 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 11050 invoked from network); 25 May 2021 09:58:46 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 May 2021 09:58:46 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6B6CB1804DF for ; Tue, 25 May 2021 03:10:01 -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,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-il1-f177.google.com (mail-il1-f177.google.com [209.85.166.177]) (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 ; Tue, 25 May 2021 03:10:01 -0700 (PDT) Received: by mail-il1-f177.google.com with SMTP id b5so7715944ilc.12 for ; Tue, 25 May 2021 03:10:01 -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=nog48O0ZANu5SovftHjJKUwbubj8NUG0oG8OQnGsY78=; b=fI5OpGMdowYuInz/ljtBg5TEjYgov4gZdiY8W+4Vbrp4nmTQLx/AV4vEK1hRnkvxPs 0S8TPET5vVz11GELsM51wzSRDc5c1f/4erA0YbhRgGnlfuSDgyX8ZpcaLKSZHgRJ/7JW 32iCTIpCkrZGDVlAuhYV7JeTjyzszrYEK4ZzpyNGH552UYpq97NCMAMztrATrKISXB+H 1KjSyclP/y2uoNk6RsMlW+zJj+q8PM4eTuNJ4oBlzakSgAvZT9Hlv57s3pjXSnUtIAdR 20hZ5v/O6QkViEg0tShccu+BVRA+rgy5QZif1yMmiNc8HyVgfmmVnxmOuPmQRaEPDBWD vJWg== 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=nog48O0ZANu5SovftHjJKUwbubj8NUG0oG8OQnGsY78=; b=Y3+sOm/six5h6kssUprzfuFJrnwLXos5bpHqokbGh748NihGEiDdZDwSrATviN6bt8 X0TI/FsUO15uyq5A3wtyvw57qJNWNY6Gd4bTLbjpvYYc6fPsgFJo7OHaZyW20+nxUW1E h6xjHhvp2gMQl8CkCVBVyq1Lp7vU4vhn8B9XMX5UytpulFYzqRKWv70RY4feXqW5PaJ1 0aLv9vuz9t24USUdQ8R6SqngTjgX3cXYtuEQQjqN83IGTrQ22+tHvVuWQhjsieDPG+lX YFbPmdG99lYwPkxe0wVFd0gwWdgXzEiz+XY4f4IqQOp1Qf+sgMPsVEZG6+h+9NedvUno b42g== X-Gm-Message-State: AOAM532ghG/y+iNBlFL/fxyY8dV66STrAuSAWPSiwBI3KB+Ngar1L4Aa TjS7KoLk+LxTl0ehXb2sN/+gxXTDqtCUkRIQhM4= X-Google-Smtp-Source: ABdhPJw5f25gLto3cB3HT1Wv05rHafYSwPECZgWvfoUfYy7LSDkXnp7y3ZyRCPzhdESLBTYPNeinnlJNWdQvqk00K5s= X-Received: by 2002:a05:6e02:2188:: with SMTP id j8mr22528979ila.194.1621937398631; Tue, 25 May 2021 03:09:58 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 25 May 2021 12:09:33 +0200 Message-ID: To: someniatko Cc: Karoly Negyesi , "internals@lists.php.net" Content-Type: multipart/alternative; boundary="0000000000007e532b05c324ba62" Subject: Re: [PHP-DEV] A little syntactic sugar on array_* function calls? From: kjarli@gmail.com (Lynn) --0000000000007e532b05c324ba62 Content-Type: text/plain; charset="UTF-8" On Tue, May 25, 2021 at 11:31 AM Hans Henrik Bergan wrote: > fwiw this can be implemented in userland, and i bet someone already made a > composer package for it ^^ > Not everyone is interested in doing `$array = new ArrayWrapper($originalArray)` and then breaking all `array` parameters. There are a bunch of different packages and people prefer different packages on top of that. Some packages will have feature X and others will have feature Y, and that makes it even harder to properly use. The downside of having this in PHP will obviously be that it's much less flexible than a userland implementation. I'd be very happy to see it in PHP while I won't even bother looking for array wrappers in userland. On Tue, May 25, 2021 at 12:05 PM someniatko wrote: > There is Pipe Operator RFC existing already, which most probably would > suit your needs. The code you want will look like this: > https://wiki.php.net/rfc/pipe-operator-v2 > > ```php > $array |> array_map($somefunction). > ``` The pipe operator feels like a poor solution while `->` would do exactly what people want. On Tue, May 25, 2021 at 12:05 PM someniatko wrote: > > I was wondering whether $array->map($somefunction) would be possible. > > There is Pipe Operator RFC existing already, which most probably would > suit your needs. The code you want will look like this: > https://wiki.php.net/rfc/pipe-operator-v2 > > ```php > $array |> array_map($somefunction). > ``` > > Best wishes, > someniatko > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > > --0000000000007e532b05c324ba62--