Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98020 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22181 invoked from network); 29 Jan 2017 16:19:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jan 2017 16:19:22 -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.47 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.47 mail-wm0-f47.google.com Received: from [74.125.82.47] ([74.125.82.47:35812] helo=mail-wm0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2B/C5-06271-9061E885 for ; Sun, 29 Jan 2017 11:19:22 -0500 Received: by mail-wm0-f47.google.com with SMTP id b65so261346wmf.0 for ; Sun, 29 Jan 2017 08:19:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=WfKCwefVGtMehgVb5LBjMDVg/GHCBE4IbDYsUkPX2AE=; b=lwaGIanuhP/SFkiidId0+rlQo6C7XluwMtKiqRCzIEBIQ2V42Kj7q9dmY53W+nvAxM 0aaH3zJ4fnIK+4A1EK0PMV7hb5AmiKkslFqnnYxCGJeMJblLoMbr8MwrM04Dl9u57E1e anOWI3ufe952lOqmHxXMstg1+Q0n8PLrP/jZd5CQAMBKpkfaxOD8X84E6e8bx7lw1JV9 b7vTrs8UjRL/DxOAaH2Lfc5z4yqw36y40eDXZM3bX1/1z3n+a4hU2BeltJgC3kkhxHwk cH6ErltIDihIPu7HHr0mYL6AoivIdfhPWnKhIKXgcEBjbSBBsMIvYDDx9omU+vY9tSGS JntA== 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:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=WfKCwefVGtMehgVb5LBjMDVg/GHCBE4IbDYsUkPX2AE=; b=cnFii0oJWdJ2iWAcLzerNg9BWthJh4PRskEmyGFVW7CPNII47K2wm9akDOVaFFGXIm UsJwEAxEl3WtSZLHNwS9YS6YpNAHbOkS0UqA1OlCf12UBMt9aWzzVkY0X8CL1hWr7v3T GRDcxvMAhbaYIWgv5aN0szDDM7/WbyqiBX8aYUWl9p+2kfaDTlIwucqxTUWwHnt+oCXY 2rajcYqUAy4uDPg/DxQ5R7h3zug+cIgzs7PL5zQ5LzLPvw7hnwJHueyO00bRpQNmp8R9 Wwv99lfdMUdls9ygMv8Ky2/Cu+igR7B3B5BJqihSwrCotc7oDTXzcSXXyD0esHu+8ynS //Jw== X-Gm-Message-State: AIkVDXI69dVpRgSnHg1hx0f07aBr97pkTsmFVSj86+LuYXnYbjO6kKU4+98SfovGOhlj9g== X-Received: by 10.223.176.175 with SMTP id i44mr15335009wra.3.1485706758795; Sun, 29 Jan 2017 08:19:18 -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 33sm18352373wrd.34.2017.01.29.08.19.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 29 Jan 2017 08:19:17 -0800 (PST) To: internals@lists.php.net References: <9113D065-B94A-4CA2-9420-56963C703ECA@gmail.com> <81.F3.06271.F11CD885@pb1.pair.com> Message-ID: Date: Sun, 29 Jan 2017 16:18:54 +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 15:37, Wes wrote: > Curious that those who are posting here put all functions in the same file. > So, why don't you just require_once('Namespace/functions.php') ? By that argument, why not just require_once('Namespace/ClassName.php)? It turns out that many people find autoloading a much more convenient and manageable solution. In particular, the standardisation of autoloading provided by PSR-0 and PSR-4 has been central to the success of Composer, and the ecosystem of reusable components that it promotes. Autoloading functions, either one by one, or namespace by namespace, is a logical extension of that, with all the same benefits. Unfortunately, it has some unique complications due to the way PHP resolves namespaced vs global function names. Please have a look through the archives of the list if you want to know more; there's been too much discussion already to re-hash it all here. Regards, -- Rowan Collins [IMSoP]