Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98023 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30503 invoked from network); 29 Jan 2017 19:03:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jan 2017 19:03:07 -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.52 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.52 mail-wm0-f52.google.com Received: from [74.125.82.52] ([74.125.82.52:33177] helo=mail-wm0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A9/D6-06271-A6C3E885 for ; Sun, 29 Jan 2017 14:03:07 -0500 Received: by mail-wm0-f52.google.com with SMTP id t18so4171262wmt.0 for ; Sun, 29 Jan 2017 11:03:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=xx1L786rCahRtSsTckYH2FGkCK2R/ygfh7MC2cp5Yqw=; b=Nxw+aiJYdUs2rpDMjTRdx5VF9KEUfwfL/3SfK+dN0j6e1kwCNZBcUZ8aINOn0nZdl3 yw1rhkh1sG6kkDs+h34G1hf7Dhyz+WVL7cXIUo5zaaWZsXyjDmvL+RpByGMjy5qmjP+1 gzPHrumDuxTgGUXvuOPRyDPjn1sbqZj0M+P6MeQdd+DKTQjihjfV8nCtnp+gCcbLo3uB EDEnu8NUvPkwMMBNIyB1DCgZTRt6ypQUsMoSP0X9lv3Rp+F/ZJRkyOEINHf7CR6zy3y/ YxRVI2oAL0R2MP2fzWS9zWgYCjEBoU5gRSkWHv709nXbgsoB2aUN+N3SaeRCun50PoC9 V+0w== 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=xx1L786rCahRtSsTckYH2FGkCK2R/ygfh7MC2cp5Yqw=; b=E5akk/KGQ4tVBEJSLup4KCEchA0Zo0WYSc9Y14cgxKoaJJIsgXADQnwluL5k+Z4rg2 7wJYiEmTjS+9AN+weYO8Or0ef9a6/8m+RzY1wdMf/OAclnaoqIiKoRribkHWJk2r9I6k qKftKnNXgXFf8LD62hkgWnjoqkGgms7weog39mJT3xK1pGnYr1wSs3Zu3Hi1wTePJ6s5 XV/j9wC+gHybYYKfS135Jwt0VGnyZiRHUzrBRQBntDTLe4r9FmLLn+mRuQtpYKzRsznp eml3yS86Rbb3RCUNQ87kYsy03uO/iA9a9YoHKLZoFIJh4Vt6jOdIU7B0zYHc0FLRyWAF Augw== X-Gm-Message-State: AIkVDXIsMbwPkGpgn4U8sYE6T8pXlJX9FW0vUOf/vsdGtIXSnXlKyhor667usv1ZljMnUw== X-Received: by 10.28.99.69 with SMTP id x66mr10588191wmb.91.1485716583404; Sun, 29 Jan 2017 11:03:03 -0800 (PST) Received: from ?IPv6:2a00:23c4:4bd2:6e00:1952:79fc:d4a0:8acd? ([2a00:23c4:4bd2:6e00:1952:79fc:d4a0:8acd]) by smtp.googlemail.com with ESMTPSA id e14sm14951944wmd.14.2017.01.29.11.03.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 29 Jan 2017 11:03:02 -0800 (PST) To: Wes References: <9113D065-B94A-4CA2-9420-56963C703ECA@gmail.com> <81.F3.06271.F11CD885@pb1.pair.com> Cc: PHP Internals Message-ID: <32ba76c4-db55-4ae3-0d32-d27ed534abee@gmail.com> Date: Sun, 29 Jan 2017 19:03:02 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Not autoloading functions From: rowan.collins@gmail.com (Rowan Collins) On 29/01/2017 17:56, Wes wrote: > Hi Rowan, I probably wasn't clear enough. How is having to write > use namespace Foo\Bar\Baz; > better than > require_once("../Foo/Bar/Baz/functions.php"); OK, your last question just mentioned putting multiple functions in one file, not that you were addressing that particular proposal. Those are very different parts of the conversation. In an ideal world, just calling "\Foo\Bar\Baz\frobnicate()" would trigger an autoloader, and that autoloader could decide to require_once one big file if that's what the library author wanted. To an extent, I agree that requiring you to import a namespace in order to autoload it is perhaps too much of a compromise. There is some advantage over a plain require_once, though, in that you don't need to hard-code into your application the directory layout of some other library; it would be more akin to having a global function like "load_function_definitions($namespace);" Regards, -- Rowan Collins [IMSoP]