Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112220 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 22295 invoked from network); 11 Nov 2020 06:25:08 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Nov 2020 06:25:08 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 31A8A180532 for ; Tue, 10 Nov 2020 21:47:29 -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=-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-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (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, 10 Nov 2020 21:47:28 -0800 (PST) Received: by mail-lf1-f43.google.com with SMTP id r9so1512544lfn.11 for ; Tue, 10 Nov 2020 21:47:28 -0800 (PST) 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=77LYQrQ6htf1ojYpOf+OP0T9MpM4RYWZAjj4li5wtDQ=; b=UYYgSHur+XoDN6VqzSqAVk8oxVwVNJuI3PRgBPZ8E18dM0M5QOC2YY8U2vWb+4tNSU pj3EmctoPWcBv20mrp5WYFmv9//1SCko6fy5UVcgeqs/UI0wXXTKE0/5u0ZGb9PCjFx4 Mf6oUpReusqGVzwF5YNCOp9Veoy+YSKNy9eJY/0UincUjsqppheJ2Koq5ErQkZH60KWf Mxv3fXsKg/xtIFnLl7U5R6hPt8/f5VKBIhXPXtiMLl9Bx0IsF0jVZg9zLxNrlw5aOv4J /adWyT9jIEZLZNwGyXIii3yz5q81NI09Lhf3W0z4zPp/XgbobX7aohHr20iitALQSGVH rJhA== 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=77LYQrQ6htf1ojYpOf+OP0T9MpM4RYWZAjj4li5wtDQ=; b=dpQOUnNOcT4ehWFtkYIReCGPcjVT3Khh31j2/iBvTgjPX/Lg0D94Un/9AWhAyF8afl HZVVvk62HmX41MMotSLG3itQYLnDpKiufaxSIYe0AFTZJ5j0PRgX9e5uM9UBjczOMYlP AnVyjbahj/nue4kfqUocjkeKeGrsQFVwrB9FJcONu/D9TBS5c8kjq01FLQkhOR6N31M/ AfDKwX5KX1ksO66w3DUYsaDzjGP7BpULKcccoKiK0LpHekYBvHV+4fV7zvI5VeFABgbH hpGw5hNcTEKSppIfLBKfyvHb1Fd9VCCH9PkInChQvY+CMahMKC4Xqc8ueohBMf0PduxZ A38w== X-Gm-Message-State: AOAM530NTJxoITVUxsFiV2nnIi53R/4kWyV+chuwqX2hov7hb2l4VCqb D1cvcWElDfZjBAzDxgWdohNUcFr87U96fgqyryw= X-Google-Smtp-Source: ABdhPJx+TWTk/lyAA3tX1gScRndPpl9KJ40wDvJ40FqBp2ALNqvgGBlx4eCsGIC3kv38DmWKgpIcPQB1vy9KTwqxKBU= X-Received: by 2002:ac2:58ca:: with SMTP id u10mr5408764lfo.110.1605073643129; Tue, 10 Nov 2020 21:47:23 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 11 Nov 2020 07:47:12 +0200 Message-ID: To: Hans Henrik Bergan Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000005652f205b3ce54cb" Subject: Re: [PHP-DEV] [RFC] Draft - Closure self reference From: zsidelnik@gmail.com (Eugene Sidelnyk) --0000000000005652f205b3ce54cb Content-Type: text/plain; charset="UTF-8" Think the way it is implemented in JS is better than `$lambda` variable. At least it doesn't have BC breaks (does it?) On Tue, Nov 10, 2020, 7:38 PM Hans Henrik Bergan wrote: > something i'm missing from Javascript is the ability to give names to > closures, > this both gives closures the ability to reference themselves, but it > also makes for meaningful stack traces, eg this is legal javascript: > > (function TheClosuresLocalName(){console.log(TheClosuresLocalName); > throw new Error("look at my stacktrace!");})(); > - the name is optional, and only visible inside the closure itself, > and unfortunately this is not legal in PHP, i wish it was. > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > > --0000000000005652f205b3ce54cb--