Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97985 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68492 invoked from network); 27 Jan 2017 13:30:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jan 2017 13:30:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.65 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.65 mail-wm0-f65.google.com Received: from [74.125.82.65] ([74.125.82.65:33462] helo=mail-wm0-f65.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6A/17-28703-08B4B885 for ; Fri, 27 Jan 2017 08:30:40 -0500 Received: by mail-wm0-f65.google.com with SMTP id r144so58348187wme.0 for ; Fri, 27 Jan 2017 05:30:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:user-agent:in-reply-to:references:mime-version :content-transfer-encoding:subject:to:from:message-id; bh=qV/r4ebXzbh9jVnJ3pWp3dORKzP6eX5ZxbY5FVu4pNE=; b=FOY0HhTxVDWxQU0YQk0AkRLw7lZB7OHtcSwCxXa1ggEv2UjG33Z9M0nDKSLYuLMZKF GlQX5z2NZcoToKcHjefCjfwqw7tu0/w3K+7Bjage/NgjCX/yUtTHoEzH0piJeVk4K5zi 4u+egqWGvjm0dRo250nWT8dJqI8q9wKGyoIO/eWs0oKfJdhZ51FGvWUvStOv+OCDUvfg /E4Tq0dNdhBEoo8PuXZ1y3gr0rl82Yc9TwVAmLD0nsQh5SYWG2lRvXhs4SnAHcFRILtg 5PB4DAyjAKSEGoLefgGxhfB0mZRsmrVwtA+6XFtQ7lshM2M/RqyirkcvEmlpKMgD2jTg HCPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:to:from:message-id; bh=qV/r4ebXzbh9jVnJ3pWp3dORKzP6eX5ZxbY5FVu4pNE=; b=ZNpE8NYT4SKmS16n4nc29LPNDm9f5LVNfnYnyMuOcrQQhnGXXhiqvUtrgbNBASdeaq 3WRKy46l+Yd648efnSt5RuTxNtMtwiqlJiuIt2M05+HeV/BAzDJBBtAdspu8T0h750Od ipkbOXeX6wArTF/ih/WtdxbIJdmSDtPZ+Mj2ESIWeKHNF8E5mit+ttFYahWpGCWXjqic /uLVhMdqvqYDV43N2nWNF+//BkwH0ptlFMmBy/buLlZnZEJdwz8lflf4fm4RgKklUK7X XqDHrbJI021xpmIwbsxr1IoPfu9ojn2R85Rq9zwvCPUsHsdTpqChGyYmUuuH37Bi4quy pgrg== X-Gm-Message-State: AIkVDXIpIWToWO4aGqy5nctXh5WdCMOfiRLge8OwTSRMOz9px3O7+DY+wyBVHg7y801YBQ== X-Received: by 10.223.134.253 with SMTP id 58mr8944600wry.46.1485523837557; Fri, 27 Jan 2017 05:30:37 -0800 (PST) Received: from [10.93.17.57] (94.197.120.94.threembb.co.uk. [94.197.120.94]) by smtp.gmail.com with ESMTPSA id g5sm7948593wrd.0.2017.01.27.05.30.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jan 2017 05:30:36 -0800 (PST) Date: Fri, 27 Jan 2017 13:30:33 +0000 User-Agent: K-9 Mail for Android In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable To: internals@lists.php.net,Wes Message-ID: <9113D065-B94A-4CA2-9420-56963C703ECA@gmail.com> Subject: Re: [PHP-DEV] Not autoloading functions From: rowan.collins@gmail.com (Rowan Collins) On 27 January 2017 09:23:38 GMT+00:00, Wes wrote: >An alternative (which I haven't properly developed yet)=2E Thoughts? >\A\B\someFunction(); >// prints: >// LOADING A\n >// LOADING AB\n As I understand it, PHP namespaces aren't really hierarchies, they just ha= ve a hierarchical naming scheme; so namespace \A is not actually being refe= renced here=2E >\A\B\someFunction(); >// tries no autoload, because both namespaces A and A\B were >// attempted to be loaded already=2E >// in other words, autoload is attempted only once >// for any given namespace The tricky case that stalled the discussion of https://wiki=2Ephp=2Enet/rf= c/function_autoloading is using unqualified function names: if you're alrea= dy inside the same namespace as the function, or alias it with "use functio= n"=2E I'm not sure how this mechanism would work for those cases=2E Finally, suggestions of a single include per namespace haven't been univer= sally popular in previous threads, because some projects genuinely prefer e= ach function in its own file (think plugin functions for Smarty / Wordpress= / etc)=2E It's an idea worth exploring though, IMO=2E Regards, --=20 Rowan Collins [IMSoP]