Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108486 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 53027 invoked from network); 11 Feb 2020 17:14:10 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Feb 2020 17:14:10 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8B34F180540 for ; Tue, 11 Feb 2020 07:28:05 -0800 (PST) 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.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,SUBJ_ALL_CAPS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 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 ; Tue, 11 Feb 2020 07:28:04 -0800 (PST) Received: by mail-il1-f179.google.com with SMTP id l4so3815327ilj.1 for ; Tue, 11 Feb 2020 07:28:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datadoghq.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Agi7rxg32PmDEc26ZeJr/Wwt2yr3AqRJR/8q9E1nqeI=; b=Z2fRllfoRoByC1KEssDXIil1HcaoT8ruVXh164kEOwfc0Eby/2oqJLRWMmtJna1q82 N8GAAYjDalOdM4+EAqRrxaQ/0aanF1Bf0UwEkib0swmZZXTCrct6an/zdHPFjrDi86uN ijlvcHhXvi3Xm92G7i8e23r9Jv/VvgAtK9IiU= 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=Agi7rxg32PmDEc26ZeJr/Wwt2yr3AqRJR/8q9E1nqeI=; b=qWm7vhTeFAOjUuFVqQnkWe30ldU9r6cxyk+K0//K6NeOX15blsgKZnu0uDwMbpvjse J1IN/2yw1I5TiFSe5TAjkSvCc90KRiqqMQ5EEHVfI4fkZhORwa4aNRh3kd3JwCZmtIbg JmbSBjCpt75/+sLsGnfRW2OOKw3zAZOVmKaY2eY8Wv7W2vIuW8PMuvmrPgg+hrXZ9Tjw 0Oi6P2VpAuiE3G3WzCjCCtZA6EDtfqmOZOnKwz5ZXV80Kwq/BpQ26r3vrQEIkBWZkGCU ZywpAv8vUXI+nnTpk5vPeV1vEWb9kIM7Pju12Usf1qfMDTF2iOeZFQUIhKxJeZqK+a2n 9N6w== X-Gm-Message-State: APjAAAViJqKYiousN9En/8+3U1m43QyKMSZofRcLT3nd9a3lub8ZNSE6 q0qO6U186Vw/dJSMceSYqT7McOa39dfFRHHKlyVVTw== X-Google-Smtp-Source: APXvYqx8CNgWL8YSIQXxnprXENQ/EnvMkV+xJTF/j2OKA2qZBkD/+lb3CjdXi/jojjgvS9lx8V6hw3jljciHy8L4U7Q= X-Received: by 2002:a92:9ac5:: with SMTP id c66mr7207228ill.232.1581434877857; Tue, 11 Feb 2020 07:27:57 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Reply-To: Levi Morrison Date: Tue, 11 Feb 2020 08:27:47 -0700 Message-ID: To: Manuel Canga Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] From: internals@lists.php.net ("Levi Morrison via internals") I have three immediate thoughts: 1. It should be `fn` or `function`; reserving a new word even if it's contextual is pointless here. 2. It should support methods. 3. It should return a closure, not a string. The reason is for consistency with methods, where we want to capture the scope at the time the closure is created, not ran. Imagine passing a private method as a callback; if it was done via `[$obj, 'privatemethod']` then it will fail at runtime, because the scope it's called in doesn't have access.