Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98230 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 755 invoked from network); 7 Feb 2017 02:01:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Feb 2017 02:01:05 -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.49 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 74.125.83.49 mail-pg0-f49.google.com Received: from [74.125.83.49] ([74.125.83.49:35493] helo=mail-pg0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EB/24-03389-06A29985 for ; Mon, 06 Feb 2017 21:01:04 -0500 Received: by mail-pg0-f49.google.com with SMTP id 194so33556236pgd.2 for ; Mon, 06 Feb 2017 18:01:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:cc:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=RaotGDA+m7VpzKYhC5Of+GRYrRfmix7+0ZvaN92Wfdk=; b=E9BpgMy5EzsjLFeKo81CxgpJ1CAw8WUWTRbgnNdN2sz1WOkeumS1XIARkEmp7svs9H LO6HbrgQ/oc9fANsghCFf4U/qYX+9U8yfcb1r5BTGU4unyoh564ch1NLmnjPM349EUwq SWk2Xb8GY80ssiGtDR88wU15wWgFb8ks2S++jp8CgC1wjHVOZ5MNpHp6L1HUi2Y+gN+9 /JPFj4FC9+sz23I2gIoZY7C4W1zoqJ7iJNQc2QeonZzjojAvWdDJh3y7Vqm5CPWcZTAq AgKN0Npp/AAOKZPYsj0UwzfXf98xbGHWmwirimE9R00Cnx38lnCqb5jI0jbhnytPkbUK F2bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:cc:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=RaotGDA+m7VpzKYhC5Of+GRYrRfmix7+0ZvaN92Wfdk=; b=Ol+l4NhgJbmr7dH24LPgXJB8Wum9e4MTPJYrRQ2Av1AVZJFicGUYjY93ffrtD9ixuu xlaVuJpoa3oe981xqUJY3r9q1wLsRqnHT8PkCby2pPkg14h/zq3byWvgoaQHgErudx1O vW7rG5uezrtyQVkn0EsJKAt29hYQhKBJssFd6doWmiiG9tzihMkFBSIUIpZj4AFmhgax l12OiizAe5dWMRWfyUSi6T7wfdkp9X5GnGZTcfs4qJDumFeLxKktjbbJGmWNxbaCJaMf hTWv6Ukw2LfELCVn6/US943F8mzhf64Oaz4k3KHuJJFbVSBcZ91Lxa+vu/OHUZOTPpoB keLA== X-Gm-Message-State: AIkVDXL3z//NqiZuFeolJ40lVgq4LgCERkoM2LYAl+nQ6ibaPwNn5hPg9u+M6y5EPtECww== X-Received: by 10.99.245.21 with SMTP id w21mr16956759pgh.117.1486432861772; Mon, 06 Feb 2017 18:01:01 -0800 (PST) Received: from Stas-Air-2238.local (108-233-206-104.lightspeed.sntcca.sbcglobal.net. [108.233.206.104]) by smtp.gmail.com with ESMTPSA id u124sm5776283pgb.6.2017.02.06.18.01.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Feb 2017 18:01:01 -0800 (PST) To: PHP internals References: <459c6bef-8936-634a-9520-dbd65c35b7c7@fleshgrinder.com> Cc: Sara Golemon Message-ID: Date: Mon, 6 Feb 2017 18:01:05 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Namespaces in Core From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > New classes within 7.2 (e.g. \HashContext) to be moved without concern > for BC (e.g. \php\Hash\HashContext) > > Older classes (e.g. \RecursiveIteratorIterator) to be moved AND > ALIASED FOR BC (e.g. \php\SPL\Iterator\RecursiveIteratorIterator) Do we really need this? I mean, it's not very likely that there's another RecursiveIteratorIterator in PHP code, and in user code it'd be namespaced anyway... It just looks like a lot of moving things around without any visible (at least visible to me) benefit. And given that no code would be able to use the long name for like 10 years, and even then why would anybody use long name if short one works.... In general, I don't see a point. New exts/features - sure. > "Aliasing" could be potentially accomplished in a few ways: > 1. Literally just class_alias(). Put another copy of the > zend_class_entry into the EG(class_table) under a different name. > 2. "Auto-use": Compile-time analysis of classname: "Is it in this list > of BC classes? Implicitly map it." > 3. ...? > > I like #2 because we can raise compile-time deprecation warnings and > we don't introduce any runtime overhead for most cases. > > Obviously, no removal of support for non-namespaced names until AT LEAST PHP 8.0 > > This two big unanswered questions for me before I'd put this into an RFC are: > 1. How to achieve BC in the best way > 2. What to do about functions/constants? Instinct says move 'em just > like classes. I don't really want \PHP\Core\Constants\E_NOTICE. This looks like annoying parts of Java too much. I mean, namespaces are great, I use them every day, they are super-helpful - but that doesn't mean we should put everything in deep namespaces - especially things that are already quite fine without them. -- Stas Malyshev smalyshev@gmail.com