Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101340 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46986 invoked from network); 12 Dec 2017 23:14:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Dec 2017 23:14:40 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.83.50 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 74.125.83.50 mail-pg0-f50.google.com Received: from [74.125.83.50] ([74.125.83.50:33381] helo=mail-pg0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2F/16-53433-FD2603A5 for ; Tue, 12 Dec 2017 18:14:40 -0500 Received: by mail-pg0-f50.google.com with SMTP id g7so393457pgs.0 for ; Tue, 12 Dec 2017 15:14:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=sR/p+KFjIXsrs3se8OAyPc0yECtiMz1E6MXWBHnedW8=; b=SqfDUCSHxq8uwrZHzM2WrCIvqwqVuKvMgkA1Q4Ese7NRQfT5aiflMfTo4KVJRl/nwo UnT7Jm8TOLATAj50w0UZCYBp0nNE4OyrUqp9SvxMwAFpshyw/1jM+EmUWjtzsDDR8vDi ZzvGDThRsH0lsfe2yObnccPrIMTOt5Y/RZNR/jtkVSySpUWYE7CQAk6trdOUavCOtFIQ I26/nEygoXzAe1cKdsbFQe77PFi5qhNQJk4jLlL0j9lguapS2gQrk+gVjPX47cXJXInH HIYcApR0/A1rxZkat6PYK+V11ybSiym6jTKIC+zClGexMSx6ErmHjmMjV3ZGOtBp/o3f s7vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=sR/p+KFjIXsrs3se8OAyPc0yECtiMz1E6MXWBHnedW8=; b=PA+oqu35OmWp53/L7D2t85P/Iu3k/WrssDGtl/isjUTHO2y//c3RgsIRfzK/fHwcAI DMxFTdKDgX4oW/p5YWg3k/qqoh7RtbTCe1yWRjs154kljEvFzQ6lJiKCvZfzFj7MbrmK bOlNjabVzlxzSvs3YrMlkmqDHvh+eoJ7puZwPkGUgPvOX3bpehosyUy9kxOs6Nj+xrb6 0RSCBTNAgKRsO67FN5l16z5c8iw9XLnspGP0gkfw7e+u+UTX7ewxy5zRNI18TzkKC/oU ACY8V1LDaGivmbFOnXDzqc9/sD076OBgVhPovkKH6DQ4TsLxO+eXLWjsaewWKqZIdrkn pbyA== X-Gm-Message-State: AKGB3mL7KyhO/TfpeVqy6Mr18mfiubqP8vOcnQRgZ6P8zPBryrdDry9+ xqsT1UXZgLxRM/UErTXI+uqUCJA= X-Google-Smtp-Source: ACJfBosii3iYp4Jfe5Iy5oTkq1p4Nh1mL0NAFHov/TeO/OJVWJNcwTX5H+ZwBxpFnQlXV8uEshlNow== X-Received: by 10.98.36.25 with SMTP id r25mr3893371pfj.72.1513120476120; Tue, 12 Dec 2017 15:14:36 -0800 (PST) Received: from Stas-Pro-2016.local (c-73-71-144-171.hsd1.ca.comcast.net. [73.71.144.171]) by smtp.gmail.com with ESMTPSA id p126sm224190pga.58.2017.12.12.15.14.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Dec 2017 15:14:35 -0800 (PST) To: Nikita Popov Cc: PHP internals References: Message-ID: <88d391e8-a37b-1272-8915-e26668a6cfcc@gmail.com> Date: Tue, 12 Dec 2017 15:14:34 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Namespace-scoped declares, again From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > There is no dependence on loading order. The implementation is careful > to ensure that the used declare state is consistent. It's not possible > to call namespace_declare() twice on the same namespace. It's not > possible to first load some files from a namespace, do the > namespace_declare() call and then load some more files. If a This means that namespace_declare can be only in one file, and if any mention of any namespace class has been made before that file has been loaded, then the declare would fail. That is loading order dependency - if A.php contains namespace_declare and B.php contains another class of the same namespace, then order (A, B) works but order (B, A) does not. > The big issue with ini settings is (mostly) not the "hidden" part, it's > the "global" part. Ini settings that change language behavior are tabu Exactly. And this proposal adds another global state, which is also invisible, so figuring out what the state is when debugging is... fun. It's better than php.ini as it's "namespaced php.ini" but still suffers from the same problems within the namespace (and namespaces can be pretty big). > this. A library can namespace_declare() it's configuration and be sure > that this is the configuration it's going to get, at the same time not > interfering with any other library or code that uses a different > configuration. This assumes each namespace is homogeneous code always belonging to the same library and nothing is every added to that namespace. This is not always the case. -- Stas Malyshev smalyshev@gmail.com