Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103399 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 1323 invoked from network); 26 Oct 2018 23:44:38 -0000 Received: from unknown (HELO mail-vs1-f41.google.com) (209.85.217.41) by pb1.pair.com with SMTP; 26 Oct 2018 23:44:38 -0000 Received: by mail-vs1-f41.google.com with SMTP id k14so1568940vsm.10 for ; Fri, 26 Oct 2018 13:00:20 -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=PnaaC6yg45SzThACwH/Sxbu5b3ahG+zvJHsFMBt+ITg=; b=hGSf6szPu16dTrder0sm3gALdfdXRv/xiZDoUU7CHqkQd7RoLGmZ/MdnR9014os6+5 RC3n1sa1uhXpoEDMLTSr9TogMLP3K6De/orkiIFvJrftCUNhdy27TA8wvNhX17ixkenO tb820dY5cON45UbRqz66LgJBhrSm9NT8tK7Ayqlq4QMTjj235cURTjqHK8daf4Sa4fwX f4g7iAA9bZpwdI/S9eog4qWk+BMgTsE9tkIFjD9SdTZaTMdNIkmnQNGvHJv56BPKYTvF 6srBIdv0ob/EcCWAWTIxQHMLHQpRvNTtc7Hcf47EM5AunXmeL+Fq49WLNgFqAxIXYwx/ Af1w== 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=PnaaC6yg45SzThACwH/Sxbu5b3ahG+zvJHsFMBt+ITg=; b=cw/I+8vog7XlU+ZgE8BBi6AR1/D7d/IWpSr8JKF/TZf8X2RKUI6DpKFmIMfHA5K+HO r1r9Ev8PGFq/mh4x1IfzhqfO5fuVjFtsDhe4PRB3nS6t3fCtoQig+05xKKsJEnkA98hH bwXeciIxkwXRoi5F0+sMxgkdg2sujLRW7Kv20GNPqIVVoK4ZE4A1q28VhtS1qzbyo4g0 AnxZShPXk2xcDaxfh9e0gLoCgnBMk5ksLaroFPjNGdCd3hLslR3BkCHMZTtRrZhrNoc2 gn57Y4gnHtYDxgaRIX1Yz09U7HLERMqM9GT2fNMcqU4ojsP0xAxp+iG3iNWSHTjC86oU nCkg== X-Gm-Message-State: AGRZ1gKOEVyAG5GUr6qry44p3UzTAGuqXTWXK+Oj5Kvyvus26htNf4px HH1Utfr5FaeN+1d4dmu6ixPNwyVwwFGkkFaj4j8= X-Google-Smtp-Source: AJdET5cK6JHQMKbY0f+ey0dQJ7V8zBsjmUV70yehLirbwicDtYEpLpMzj0FDQ31VEmabaRtca27dODO/yhFIDeSQvac= X-Received: by 2002:a67:2544:: with SMTP id l65mr2191967vsl.225.1540584020590; Fri, 26 Oct 2018 13:00:20 -0700 (PDT) MIME-Version: 1.0 References: <2370262.6EcsR2toYx@vulcan> In-Reply-To: Date: Fri, 26 Oct 2018 22:00:07 +0200 Message-ID: To: Arvids Godjuks Cc: Kalle Sommer Nielsen , Larry Garfield , PHP internals Content-Type: multipart/alternative; boundary="0000000000004b46700579272b7a" Subject: Re: [PHP-DEV] Idea for better function callbacks (another syntactic sugar) From: crocodile2u@gmail.com (Crocodile) --0000000000004b46700579272b7a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Yeah, that was part of the idea, the other being to make these callbacks semantically different from strings. Its just weird that a string is callable, isn't it? On Fri, Oct 26, 2018 at 6:03 PM Arvids Godjuks wrote: > =D0=BF=D1=82, 26 =D0=BE=D0=BA=D1=82. 2018 =D0=B3. =D0=B2 18:57, Kalle Som= mer Nielsen : > > > Den fre. 26. okt. 2018 kl. 17.43 skrev Larry Garfield < > > larry@garfieldtech.com>: > > > I believe the proposal for short lambas (which should get resurrected > at > > some > > > point) would handle this case well enough as well as help a dozen oth= er > > > things. To wit: > > > > > > array_filter($names, |$x| =3D=3D> trim($x)) > > > > I still fail to see why it would be considered to have that over a > > perfectly encapsulted string for a callback, using a lambda/closure is > > just an extra runtime call for syntax sugar, that seems poor in my > > eyes. > > > > Right click on `function::trim` - Find Usages. Basically allows to find a= ll > usages of a given function, including the callback usage. > > > > > What would be ideal here, would be for functions to be first class > > citizens in callback contexts, like in C to avoid the quotation, > > however it clashes with constants. A hack you can do in userland could > > be something like: > > > > const trim =3D 'trim'; > > array_filter($names, trim); > > > > > > > > -- > > regards, > > > > Kalle Sommer Nielsen > > kalle@php.net > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > Arv=C4=ABds Godjuks > > +371 26 851 664 <+371%2026%20851%20664> > arvids.godjuks@gmail.com > Skype: psihius > Telegram: @psihius https://t.me/psihius > --=20 Best regards, Victor Bolshov --0000000000004b46700579272b7a--