Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114533 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 29223 invoked from network); 20 May 2021 14:06:54 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 May 2021 14:06:54 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id EDEE71804B5 for ; Thu, 20 May 2021 07:16:55 -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=-0.2 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-il1-f179.google.com (mail-il1-f179.google.com [209.85.166.179]) (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 ; Thu, 20 May 2021 07:16:55 -0700 (PDT) Received: by mail-il1-f179.google.com with SMTP id m1so13669307ilg.10 for ; Thu, 20 May 2021 07:16:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mirtes.cz; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jTJtrJey0+n+tyoqtt6kh5nNBuUH3Oa+U2guyizef/I=; b=jJFfODqGboAnfxkXD3ZdMizYtB6wOeYeuw7IzklHpJ1a4uWHzg6I99B82KOy37bE6d XJNb/ka7gSdAOZ8Hwadb+J//NkVNxhEitgCChiZPLaumYh5mv7MENH7nJ+bbkcLvGhZO Wx1k6+7lPJxEnDKgCL0hugkknDitwfX7SHt9I= 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=jTJtrJey0+n+tyoqtt6kh5nNBuUH3Oa+U2guyizef/I=; b=pKZ4l6OdjwVUuHDANEgGNan76lJSTeE9RVdGWJe18QhhJY5bUZgqcYo3wtM+ibwNhn gFgveo6+WHv6SWzyqsaekM5X8V9SBhGuwespJ0vqSL1bDyIhSCTaTGa1RJYRiO2ne6uv iAJvupfauXYC5zJqRN99mNrnZsGqFaVeG6nozS016hTriOmhdl0ADPivCXIvT3gdCl1w 978HchN/hHvDqgus6Y59HL2FpPTXfe8gwKYfHKQ/qr8yXhzMOJlGj2k61Blf50D4bIdj MDeTVwf/fsq31EOIQPFXQzNxOy/e3BWVJ9lI+uM2miS4gtCpMGs39He+/8Fmpnw+LHov IyHA== X-Gm-Message-State: AOAM530CKSW6UuhtJcPzo30rPajd2y6m4p3CLSDD18XJ4lideZpWSs8y gJSWO5/KT51AmaqnojgrjMQaLpWiholi0WqfwR/+0A== X-Google-Smtp-Source: ABdhPJyhNmfppY5aRZ/c4N/uw2htyDSjF/gTQ0M5FOgouFeSE8+h5M7jAdxn1hTXfdbn/+tLDrFAAinI8vnQdpjzc7Y= X-Received: by 2002:a05:6e02:c3:: with SMTP id r3mr4962869ilq.280.1621520212348; Thu, 20 May 2021 07:16:52 -0700 (PDT) Received: from 1064022179695 named unknown by gmailapi.google.com with HTTPREST; Thu, 20 May 2021 07:16:51 -0700 Received: from 1064022179695 named unknown by gmailapi.google.com with HTTPREST; Thu, 20 May 2021 07:16:50 -0700 Mime-Version: 1.0 (Mimestream 0.20.0) References: In-Reply-To: Date: Thu, 20 May 2021 07:16:51 -0700 Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: multipart/alternative; boundary="00000000000040ebfb05c2c398e7" Subject: Re: [PHP-DEV] [RFC] First-class callable syntax From: ondrej@mirtes.cz (=?UTF-8?Q?Ond=C5=99ej_Mirtes?=) --00000000000040ebfb05c2c398e7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, I=E2=80=99m confused by the syntax, when I read it, I think to myself = =E2=80=9CI know this, this is just a method call=E2=80=A6 oh wait, it=E2=80=99s actually a = callable=E2=80=9D. It really makes my head hurt. Also, static analysers already have to reason about current code, so PHPStan (and Psalm probably too) already supports referencing to callables as strings (global functions) and arrays (methods): $name =3D 'date'; $name(1); // Parameter #1 $format of callable 'date' expects string, int given. --00000000000040ebfb05c2c398e7--