Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94940 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 685 invoked from network); 8 Aug 2016 16:57:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Aug 2016 16:57:56 -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:35298] helo=mail-wm0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AE/74-33134-21AB8A75 for ; Mon, 08 Aug 2016 12:57:55 -0400 Received: by mail-wm0-f47.google.com with SMTP id f65so128535884wmi.0 for ; Mon, 08 Aug 2016 09:57:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:references:from:to:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=bhoVE5xzWcgqZAH1P2MN65O1m2jBtppt6oWyF5fStCc=; b=dQikuAOrGMO5VBu1ZNsIsjg88FnOMsiR9YeISevTbqV85OZ3dC0jCpozxhqt5XUk3n zM4Sz72dm1DFaCjgXwCx0cnSArnWfcuSLJYP0DUjVslsA9qcfRURS6escsNQKsMRYfRd OH3T2d/6c0vP6ebhafS4FC07VCiChIPHr4PsjmkRmOAcEGoDe0g+RcxhKwQOULw2//qp hueSiWn9A5XlL1Aq8ax7WjfB9n8VetCVlnT2JSjA3Es4FqnLe+ZiDYvkWjouLy1SEF4e 8Sxq76igti8a1UE8/GonMiiBAu6QpckWmKGhuRb5TD8Q/Veae4uiqnj8+pMoTXbujtZ/ +36w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:references:from:to:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=bhoVE5xzWcgqZAH1P2MN65O1m2jBtppt6oWyF5fStCc=; b=ShvTGOgavxR+X0pjpdER6Zu/JVoNXhh/XQugHTS0MO62BsGZjwEeg29dG0Y+NiAc7a hMpP3gLS0iTZpe/nUpV526+/LWbwMeSS59QwyomzMeXoYMwX4xi3EkIVrAXU8ZzpbRgv +fqPsn73dPMgb9oaYAu8gtvWfHCugllTIm70TeurJsvU1fHfPY2+n2R+7MioptyB2D8D maiehU8Q00af+Lu9F6ZkbbPTPGX7LGDTm8G6rnh7+gskDihWWWByM34jxZ9EjMpcSAFa uCLGsthN9IvUNXJw1J/R0CHgc/BI3ulpTNS9lIcqLG7JknX1zyAPpjbaHzqFdRdUGNqP IbPw== X-Gm-Message-State: AEkoouvy/hmg0rgLhifl7iRMiiu60aLvKj2NTV/De9v6AKzT0MYk3gI9Aql82IxKj56AXQ== X-Received: by 10.194.32.195 with SMTP id l3mr83603203wji.27.1470675470913; Mon, 08 Aug 2016 09:57:50 -0700 (PDT) Received: from [192.168.0.98] ([93.188.182.58]) by smtp.gmail.com with ESMTPSA id ly9sm33759843wjb.44.2016.08.08.09.57.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Aug 2016 09:57:50 -0700 (PDT) References: To: internals Message-ID: <673fe00d-9037-aad6-fd14-12b8d017eb7a@gmail.com> Date: Mon, 8 Aug 2016 17:55:38 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.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] Function auto-loading From: rowan.collins@gmail.com (Rowan Collins) On 08/08/2016 17:23, Niklas Keller wrote: > Loading only full qualified names will lead to strange bugs. The suggestion is to require *qualified* names (at least one \ in the call), not to require *fully qualified* names (leading \ and full namespace path). Function name resolution already requires that to reference anything other than a global function, or the exact current namespace. The only scheme I can think of where it would matter is one-function-per-file, like Smarty's plugin loader. # file foo.php namespace Acme\Plugins; function foo() { echo 'Hello world'; } # file bar.php namespace Acme\Plugins; function bar() { foo(); } # will not autoload Compared to "hundreds of lines of existing code will go slowly unless you liberally sprinkle with \", having to remind people not to do that seems like a small price to pay. Regards, -- Rowan Collins [IMSoP]