Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118156 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 8087 invoked from network); 1 Jul 2022 17:09:08 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 1 Jul 2022 17:09:08 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4A3061804D0 for ; Fri, 1 Jul 2022 12:00:57 -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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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-vs1-f52.google.com (mail-vs1-f52.google.com [209.85.217.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 1 Jul 2022 12:00:56 -0700 (PDT) Received: by mail-vs1-f52.google.com with SMTP id h7so3135492vsr.11 for ; Fri, 01 Jul 2022 12:00:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RN9lF90J0z2O93kMfWK6cTskDuWgZ1a3hj5YXmE9PGc=; b=76diXFzhIh+3xiCQIeHrHjh6S/xXGcQPaaaU9b54HsIvXdh4ajo5TUdl6ZVF90bxFj /v6cBNmPuHvHMWKVR+IGOXJwCpKFNnX1UEC9iIPIGT4sDvLEumVLLglF+h8skIMhv6ou KC0kPLwJCxkvTg0U2vVItCrtCGzog9i8i5SUdAOyqMGsnqJV3YdD+Hc9NwJotvuDuBr4 AQC9WfMB0NCdfN1keJFGIKW/Pf2AjBLx/CyshHvHUU8ciyxXt6CdiAvE/j+YwivBvvDi yRqzmpiZ+1j2YF/md0PXDGbxQl9mzwJP0pc9/qQ2EIZA2Qh0IXyUFfjhZRO/mgwtlgw8 HtdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RN9lF90J0z2O93kMfWK6cTskDuWgZ1a3hj5YXmE9PGc=; b=m90TZnKXvk/w7E6Gmpt2b4qA/PhLg3ddcjT/wqe1DYWyGto9r2ZX7ke51vxsLuCcUP OcWRK4Dib7mYGbXODJZNaDBiZRp1cCMWZbkmDdyfyOVMlLv1BW5wvac8PYzfvNX1NhXt hdTGfNujsDMc//jpb1a1h/DcTqh/ZZc816mUo71zhzYfKoARdnH/RoNf8eKxLqHeisyo HIPbnz+XhhwAecSm2y1v+ZnR4KSOA5CtYeJ188H1kuORAjXTZ2lfZpFYiLahmrN05Qwf smKuHx26VWCkZb309QGmKgZ9qy+z2nL36nHUTPRu1PZY5o2EW51LR7YANnmkZ1MvhYoR wX7A== X-Gm-Message-State: AJIora8RET6FLEQPIuG852SKvuJXe2SbCLdtpVfZgO0SouyVtXlVdLFp bJW/md1j2mmu/FXsFSKPUfkAkucEuFAYrJzm4O/fMtJg0B/YLQ== X-Google-Smtp-Source: AGRyM1tx/7CbG1uYcw7CRk2/5pTT3EKbPeOLud47qbmwyuDegJ5czAjTKx5J9QnQwxSQG7Wa0NyPhLDJJak0O5cUIsE= X-Received: by 2002:a67:d318:0:b0:356:6fa0:b39b with SMTP id a24-20020a67d318000000b003566fa0b39bmr11475122vsj.2.1656702055854; Fri, 01 Jul 2022 12:00:55 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 1 Jul 2022 20:00:41 +0100 Message-ID: To: Larry Garfield Cc: php internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC][Vote] Auto-capture closures From: Danack@basereality.com (Dan Ackroyd) On Fri, 1 Jul 2022 at 15:05, Larry Garfield wrote: > > The vote for auto-capture closures is now open. It will run until 15 July. Voting no as: i) changes in the implementation need more than 1.5 hours discussion between that change and the voting opening. ii) The inconsistency of capturing rules between this RFC and arrow functions are "not obviously" the correct choice. And definitely need more than 90 minutes of thinking about. iii) Some of the phrases in the RFC are still just not true. "Capture is by-value, no unintended side-effects" "A by-value capture means that it is not possible to modify any variables from the outer scope" "Because variables are bound by-value, the confusing behaviors often associated with closures do not exist." They are true for scalar values, but not for objects. RFCs need to be written clearly so that people don't get the wrong impression if the don't read every single word. btw for my concerns about object capturing and RAII, the manual could probably say something like: > If you want to ensure an object is captured you can either assign it to itself: > > $foo = $foo; > > Or create an empty function: > > function ensure_variables_stays_alive(mixed $variable) > { > /* function is intentionally blank */ > } > > and call that function with the variable you want to stay alive inside the closure. But again, this is "not obviously" the correct choice. Dan Ack