Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129060 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id 9232A1A00BC for ; Tue, 4 Nov 2025 02:16:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1762222597; bh=6YH25TdtgcgmaQvCvtZYZIVmAxSPFkOLX9rV6J6SDtU=; h=From:Subject:Date:References:Cc:In-Reply-To:To:From; b=nS/zc5xuE3XzbjRwqvx0XEjQKMD/1muNGlHaV6WD+AUKnir920cfoFC6rgJQEagPE aOyHPDsGLtYdWdLCNgWQVRRyWmJk4DRabQtTyMtk/cIC/xdUlKVuytNwoSh/QW807Z KlfjhUWFVrDwwCs/5uhIV0axdXFixe5/DKyUAA/nIh+WxvINaQlXQCIdXc/BAqjs0q fCccLVRIwNH70E3Agzj+McycWJphqBS2LSOvEB4oAWLp4JU2BzLOQrxerK4f/p4a7l HyA68JIca++RV0EcfgYuNd4Yhv7LHQac1KW32vyvvRqpoC2P8h7JZiMqMqhZYZjXlT GcL8qN89Ej9qQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3B91B180088 for ; Tue, 4 Nov 2025 02:16:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,HTML_MESSAGE, MIME_QP_LONG_LINE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-oa1-f49.google.com (mail-oa1-f49.google.com [209.85.160.49]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 4 Nov 2025 02:16:35 +0000 (UTC) Received: by mail-oa1-f49.google.com with SMTP id 586e51a60fabf-3c97813e788so3172150fac.0 for ; Mon, 03 Nov 2025 18:16:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=benramsey.com; s=google; t=1762222590; x=1762827390; darn=lists.php.net; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:from:to:cc:subject:date:message-id :reply-to; bh=7I9RUe56y2aZP8GdLEIjtnJX8f0y4kJWJbqzkNnPOBQ=; b=SiUA9SV+YmUSaUyEGaBCfEVzHrhxiB8pQOaQ4N0zFjUvb7zA2moitSqi31c3zgCTB0 JW53hlAwvM2vEMjxhZD4azB0s7I6yMjSLnfhc3PGRc1v47Gs+pDO+QOGHaJX3CV1xq7s onOEzAzxvaAL1+h2d3/3uzYhlGbhoko5rKzA2HI6bgCLxOoocwwejHUPEi3/FiXzMQT0 YgdyPTOe2P08jTye4ZtrB5iuKvn2dgflCsYbBH/gqmYDdqyjG5uNhjguSI+rXBdOvqtt M3/yRjd8EpDP5n0XVAo+OkMVfmkX2RdxwJqnzK6NL98PQLvRGVb8+ZnlT2MeU9HveGf/ PZng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762222590; x=1762827390; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7I9RUe56y2aZP8GdLEIjtnJX8f0y4kJWJbqzkNnPOBQ=; b=eRv2x2thPk+ia6D91+65f37fgUi4pks8YU+45kVsblbSLmhkJjpNZghlLfw6KB7PAv 5sw18e4X0/xygNADqzM7N2xWeG+LGMM3qe2zhdwPA4yTWEWkqHSHFlThSeS+G+c8/BSt NzIYNgEGoqIsogrKKEDnEhqUxh1aOV6J9xTjvUOnM7hl/3Nyk2RmGGYH4s7k+Ulvxdhp jNstfhEAN0mqAHGgUSX3a3Dn2YISfkAu98pFR/emHPnPddjiwFZSTDbFx88El89BBjai 9W33nd544IAncDEJ82lXaUZVv6JrjC5GULwvhjm/ZFD3M+Phpu5ERxBdHClZ9b6bGiLP fLoQ== X-Gm-Message-State: AOJu0YyPGpZN9CkO1A/ITjicEqKBj3egKmLPavjbYkZmm77X0IJ9c3hi A3ijjBOR0MoNqHNX1aB6OJwL5fFuTmisTBWs+Fwfo3uCvvJA/WF8kuURVBme/Z/VlmsM3DFTdf9 Nrhelu42F X-Gm-Gg: ASbGncuaQMWZyDGr+Hc5od/QPYOY7CZsOk7G90pM5r80sex5gqv4ZFgRl01jtSykZ5H es4M9K5on0HHPlc5jdyuxStRrD7EvRCxVZvaMGkh/kL1LyuD4jNe1abfzRnxlIXP+arRBdSdBMF NPpxwe8cqxOYtq2IlakGGTHVz5Im6lJt2VmwnvwX8zg8/qphecq5PRdvK2ydn9fv2dRapUTfijI L/7Bl/8+TfL6Bf+04Sy/meBqKHjsQshszwj9CKdHIkbJYEMoD3ga4HdShvC7LvNFpYwxsxEUrL4 8ZvImfBUtKbmc0CgZv/o1Lqc3IZMMMniRSBXaGootbOMZWym2fCt/yV3yXJCORgmxkHXS9X4aiY 0+LLE6ObEWXRV3P4qb0UBoSs8b/XB30nGv0gk+0qU0f+ZNWn6kgcHnwQmVaufC1OoE+JyNJt9qT GrGO/NH9czAZ8ksne4wzeJAYFq/U/74Swr77TmH4W2H5FW3gHruKR+p8Qwa0dYkmxngqQ= X-Google-Smtp-Source: AGHT+IFZeh0oC+gYbQvPkkqjm/KVpvGTmAf0YvOhe61emv51P8F59d9YM9Z6icQ+n9IZc2wt3d/Hkg== X-Received: by 2002:a05:690c:2781:b0:786:6212:fc89 with SMTP id 00721157ae682-78662224adfmr137819477b3.0.1762222103343; Mon, 03 Nov 2025 18:08:23 -0800 (PST) Received: from smtpclient.apple (h96-61-170-179.lvrgtn.broadband.dynamic.tds.net. [96.61.170.179]) by smtp.gmail.com with ESMTPSA id 00721157ae682-78691db0c3asm6209467b3.17.2025.11.03.18.08.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 03 Nov 2025 18:08:22 -0800 (PST) Content-Type: multipart/alternative; boundary=Apple-Mail-9B3FF7B5-128C-4D75-8A6B-4C4A827BDF80 Content-Transfer-Encoding: 7bit Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow Mime-Version: 1.0 (1.0) Subject: Re: [PHP-DEV] [RFC][Discussion] use construct (Block Scoping) Date: Mon, 3 Nov 2025 20:08:12 -0600 Message-ID: References: Cc: internals@lists.php.net In-Reply-To: To: Seifeddine Gmati X-Mailer: iPhone Mail (22G100) From: ben@benramsey.com (Ben Ramsey) --Apple-Mail-9B3FF7B5-128C-4D75-8A6B-4C4A827BDF80 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > We wanted to raise a few initial points: >=20 > The RFC proposes the `use` keyword. What are your thoughts on a new `using= ` keyword instead, similar to C# or Hack? >=20 I=E2=80=99m undecided on this. However, `using` might be easier to understan= d since `use` could be confused with the existing keyword. > How do you feel about the questions raised in the "Open Issues" section? >=20 I prefer Option B for restoring the value. > What are your general thoughts on the RFC? >=20 In general, I support this RFC. I=E2=80=99d like to see examples from other p= rogramming languages, though. You mention C# and Hack above. Can you elabora= te in the RFC on how they implement this functionality? What about other pro= gramming languages? I know some (Rust maybe?) are scoped to blocks by defaul= t. Cheers, Ben --Apple-Mail-9B3FF7B5-128C-4D75-8A6B-4C4A827BDF80 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
=

We wanted to raise a few initial points:

  • The RFC proposes the `use` keyword. What are your thoughts on a new `using` keyword i= nstead, similar to C# or Hack?


I=E2=80=99m undecided on this. However, `using` mi= ght be easier to understand since `use` could be confused with the existing k= eyword.

  • Ho= w do you feel about the questions raised in the "Open Issues" section?


I prefer O= ption B for restoring the value.

  • What are your general thoughts on the RFC?

    =

In general, I s= upport this RFC. I=E2=80=99d like to see examples from other programming lan= guages, though. You mention C# and Hack above. Can you elaborate in the RFC o= n how they implement this functionality? What about other programming langua= ges? I know some (Rust maybe?) are scoped to blocks by default.
Cheers,
Ben

= --Apple-Mail-9B3FF7B5-128C-4D75-8A6B-4C4A827BDF80--