Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98221 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77176 invoked from network); 6 Feb 2017 20:27:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Feb 2017 20:27:22 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 74.125.82.181 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 74.125.82.181 mail-ot0-f181.google.com Received: from [74.125.82.181] ([74.125.82.181:33013] helo=mail-ot0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A7/D0-03389-82CD8985 for ; Mon, 06 Feb 2017 15:27:21 -0500 Received: by mail-ot0-f181.google.com with SMTP id 73so70956429otj.0 for ; Mon, 06 Feb 2017 12:27:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=golemon-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=6fI1jVR5XLkK7iDSP3/iGaadjxB8Aun8LkwsYdo/uI4=; b=A54X/CE2cj1/Un2pEJ7xKAILfxN+EjKfzDHC8BivNNUMlP/MBlUEQqtRlaG/LqBDA9 lbqYt6Qj28zAEQvZ3IUjgtkbySQu5F/exiHXtC8nooD+VeP9YYmRhYX2Qk4alLFYo1fJ wpgDusl1+XJnNjtosewm8w4sN4BN/rw3XaYcU7fMJeYS4WIEG4ALn9zXylFlqQN6bELO g7nWLqrDxp6tK7aXBABOVoaCedbUW+XGqjiqGL3WjCbmLVEdFIcsJBotYsPuw6dcvVS0 oj/hVuqMhyuHU0OKAzG66FUGWsMnR4qO4xbicUUzYZf1IK5ebv77hiCvem+3l7HuukcC frug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=6fI1jVR5XLkK7iDSP3/iGaadjxB8Aun8LkwsYdo/uI4=; b=ei9Kk6PSTo+Qledf1zfk49uDKOcFU2KZLlPNlAO90+lGflK9bWPZkQE8ewfuRYOCtw muqXfKcOTIio7H/SD7IEqzSzsDrThM4WmtMD4Sd588nsUUiozHIzgxkPNP4DVGfvmiXC hmsJDqXpsUd3SLvdcDzIIza0wGsDfe2fKcSCieBNgYV0hQMjH7ye6GRfk8ZLyhL9O99Q PrKhQ56BC0VR/w4GuNYULW3B4r41CJM3v5Hd8geY9606a3R5/hnpQt9MtNd/ouLNtUxd 39qHG23XX1Clieffh4DT7q2VjDt0Cidxc5BB22YJ6jfT2CihWpMtGjnt292b8mNp0e58 gNLQ== X-Gm-Message-State: AMke39kJVvh+WCVPCGTAxoTRtdsgtZf6LJ1R5lVlduTFY5gokCVOCUDteukBaZ8fUM3209tuDXbDWoMpExxnbQ== X-Received: by 10.157.60.20 with SMTP id q20mr5453434otc.193.1486412837945; Mon, 06 Feb 2017 12:27:17 -0800 (PST) MIME-Version: 1.0 Sender: php@golemon.com Received: by 10.157.14.104 with HTTP; Mon, 6 Feb 2017 12:27:17 -0800 (PST) X-Originating-IP: [73.9.224.155] In-Reply-To: <459c6bef-8936-634a-9520-dbd65c35b7c7@fleshgrinder.com> References: <459c6bef-8936-634a-9520-dbd65c35b7c7@fleshgrinder.com> Date: Mon, 6 Feb 2017 15:27:17 -0500 X-Google-Sender-Auth: ztQPlrhIRzViWFZ6aOw7bKiLRq8 Message-ID: To: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Namespaces in Core From: pollita@php.net (Sara Golemon) On Mon, Feb 6, 2017 at 12:21 PM, Fleshgrinder wrote: > First: I like namespaces in Core but here me out! > > The PHP (case does not matter) would be the proper vendor name to put > Core stuff in, as far as I remember it is also reserved for PHP > functionality. There were also numerous discussions about providing a > cleaned up API there while maintaining backwards compatibility via > aliases and so forth in the non-namespaced Core stuff. > I've been having this same thought lately since looking at the sodium RFC. Here are my thoughts, centered on the goal of having classes (and maybe functions?) in a \php\{extname}\ namespace hierarchy. 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) "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. -Sara P.S. - wrt libsodium, I think THIS issue is enough for me to come down on the side of voting non-namespaced to avoid it being an odd-duck.