Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94988 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72008 invoked from network); 10 Aug 2016 08:58:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Aug 2016 08:58:45 -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 209.85.192.169 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.169 mail-pf0-f169.google.com Received: from [209.85.192.169] ([209.85.192.169:36751] helo=mail-pf0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3E/8E-03404-5CCEAA75 for ; Wed, 10 Aug 2016 04:58:45 -0400 Received: by mail-pf0-f169.google.com with SMTP id h186so14058620pfg.3 for ; Wed, 10 Aug 2016 01:58:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=4rXTNGG6iVCDZnNhYQmhTHSfRUo++onIIP5KknRYtP4=; b=TsdRpiZJgRrmn2C2I6BljuUZEoAWjg9xoOn2gm2ANGO/GVQEKyNVqnZZuSwmCQTJek SHSOWOWeHxAiq54rnUR0blnDz5a3qqnb4lJ6TKwgUFbz2t1JK+xKXssr3LnubXREFyQk 8GLR2XwsVRJnIrYpO9ZYig6IhjzpFBqGTBQ0o7GD7TmBOGnWvruV5SLH4aMePrOMjfhh gNAIh3vtsqdP2m35sRHU+PhceSXBs0TZRUWotN0LdQ3FrXOnPbGzlmmfU9JjQtqb/KJQ WccFmoVcbuWPZYYvAkqm0y+5ckiuKw3eerMlNc1sECFWc+5paceVpiagL7wEVsJm4x/C uYcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=4rXTNGG6iVCDZnNhYQmhTHSfRUo++onIIP5KknRYtP4=; b=EjnKa9Z/lyfn9kfxJ+xDXYYJVtFcbZK1oprAiIniSxJOWxLj6eVC6lJ0bJv9B1+bCy af3Oj3sHf3fu0j3jqwGtMoM8rRGMbkDstEAlwYz3MbisqVXBdJmwBKjICIf3Kr5Kmlbi 1wM59TCDlwHg4HY92DBrwVS8Qt+GoinGXbypuZITcBN8ZDgMBnkXFVxQrSatq481Q0lY 7rqH1cKMn6O+3rUE0PTg8MxmcVsYmWiJIWfBgAQOQIThpPWFCDXbOlFA50MAdhesrD6e 402pbSscLuWdgnDRzBU5KVbhrH18UeCZVslcosGnJVhh+Bj9WkUJnv843cijQsPriTb6 YWxg== X-Gm-Message-State: AEkoouuaTUyRBSmRyKeAuqGgOkYEDPzGqfuujRzse5WfuxFllCrABtQgZAEWCtZjbV+3qA== X-Received: by 10.98.98.193 with SMTP id w184mr5119924pfb.120.1470819522158; Wed, 10 Aug 2016 01:58:42 -0700 (PDT) Received: from Stas-Air.local (108-233-206-104.lightspeed.sntcca.sbcglobal.net. [108.233.206.104]) by smtp.gmail.com with ESMTPSA id x126sm61900483pfx.61.2016.08.10.01.58.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Aug 2016 01:58:41 -0700 (PDT) To: internals@lists.php.net, Rasmus Schultz , Rowan Collins References: <33781781-2a63-78c1-68a1-9e19ad720d8d@gmail.com> <1d89ec68-de5e-2670-aed1-f12872c073c3@gmail.com> <615f02b9-0621-2e7a-bec9-af4e342529b2@gmail.com> <80776a32-5eda-271f-4270-2843b453a545@fleshgrinder.com> Message-ID: <8ac85eb6-0ecd-7b11-076a-da6cb9fe3184@gmail.com> Date: Wed, 10 Aug 2016 01:58:41 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <80776a32-5eda-271f-4270-2843b453a545@fleshgrinder.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Function auto-loading From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > Having the use statement trigger the auto-loader would result in a lot > of broken code because of optional dependencies (remember the examples I > showed you in the annotation thread). I think it's not a good idea in general. use statement right now is basically a syntax sugar - you just change interpretation of names. But you don't cause anything to load by this statement. Changing it would mean people have to change a lot of assumptions about what is loaded when. E.g., there's a lot of code which use's classes and spaces that may not even exist - just because they *might* exist in some scenarios, and will be used in those scenarios, further down in the code. I don't think completely changing the semantics of a very widely used statement is anything we should be doing. > This would make it even more painful for users to define anything in the > global namespace; a good thing. No it's not. Why should it be a good thing? > It would however encourage people to prefix their stuff inline with a > backslash, otherwise you end up with an endless use chain for every I'm sorry but this is horrible. PHP code should not look like a fence of backslashes, backslashes do not have any useful function there and in 99.9999% of cases global functions *are* global functions, and nobody is overriding them. Yes, you can override strlen. No, nobody (within 0.00001% accuracy) does. > built-in feature which is not nice. That being said, it's required > anyways if we are really going to introduce namespaces for everything > within PHP (e.g. `use function php\random_bytes;`). Something I still > think is a bad idea at least for procedural first-level functions. It's a bad idea for all existing functions and classes. Because it adds complications for people without giving them anything in exchange. -- Stas Malyshev smalyshev@gmail.com