Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94970 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4935 invoked from network); 9 Aug 2016 16:20:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Aug 2016 16:20:00 -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.46 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.46 mail-wm0-f46.google.com Received: from [74.125.82.46] ([74.125.82.46:36439] helo=mail-wm0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CB/44-03404-FA20AA75 for ; Tue, 09 Aug 2016 12:20:00 -0400 Received: by mail-wm0-f46.google.com with SMTP id q128so43488603wma.1 for ; Tue, 09 Aug 2016 09:19:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:references:to:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=vkrChIa9Vo14mi1962yQ4mWpC8VcFHiZJZAV6EIA+88=; b=GbMBCSscQryWqn221W8GiglSct3S1RlRj4+mB2TgfINj0y6VdnQ1CFJBB2K0Zoj+ll WxM+WdhiqT5p0qRCktNIBmYPX2Scqrnv19zygfrjK9CylKpNpdq+uJTg5cZUPOQqUjBV kPKEByRWfJu+cAIxPP8uMMy0e3V2EiMkVTErPHTCiBfFTQZLIJRdHhNzNYTvQc7k+THJ QbnwmVQ9lOnBoQC0gXp+L7IiBJRPNddNetqZ6XcYRONxzU9t+hN/wrgcCgQ3RulbJ9AO gr0rd6cdKBVLeRuSboJ/ruj9jmf130kc2rWZzj4hVJeuqLpEdgijqSog4pG7/K1/sMGR RH9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:references:to:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=vkrChIa9Vo14mi1962yQ4mWpC8VcFHiZJZAV6EIA+88=; b=jXEmA/VQTKcEwjfm2tAXlw3oP03Ln2U3YG4IrChnKNwFM/oKtaTNQLTOaeMvwS9x+M gyinyddlkOxUmMPTSwEtM7Nw3ZcuKcSNxDTiFp5VmHPtRprTqw8/zPEqhQ+AD9YAD83r //10gBMf/w5b6CtqJzcKsIZwnA/9ezYMnsnLXbxIIkXrnH67z+Gd5kxm4LIN1hwITucS k7bYtEstS/zajVtnW13t8t/eNemJyYMReQzLqYaCZWRf6V1BIQ8qXmFlJKdN4x1kr8N1 0jRzaO8QAXm5n5rITH+DaKL8z1ylcotcevOIw3+LPKWGQhS9tKOyF41fD0OtZJLe2mOh YIOA== X-Gm-Message-State: AEkoousDGw2U487Yw463I2h1iHmLwEKfNHkR8DYK7hCnqgC8Vkdkrfxfwqm9jcTJVlCPog== X-Received: by 10.28.128.15 with SMTP id b15mr23380741wmd.100.1470759595752; Tue, 09 Aug 2016 09:19:55 -0700 (PDT) Received: from [192.168.0.98] ([93.188.182.58]) by smtp.gmail.com with ESMTPSA id 190sm4037331wmk.13.2016.08.09.09.19.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Aug 2016 09:19:55 -0700 (PDT) References: <33781781-2a63-78c1-68a1-9e19ad720d8d@gmail.com> <1d89ec68-de5e-2670-aed1-f12872c073c3@gmail.com> To: internals Message-ID: <615f02b9-0621-2e7a-bec9-af4e342529b2@gmail.com> Date: Tue, 9 Aug 2016 17:17:39 +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 09/08/2016 17:05, Rasmus Schultz wrote: > I'm suggesting the use-statement be the trigger, rather than actually > calling the function. > > In other words, calls to substr() does not trigger the resolve - a > statement like "use function substr" on the other hand, does. Ah, I see. The problem with that is, you still have to explicitly list every function you're going to use, so you might as well just use require_once, or call "load_function('substr')" directly. > I think, in practice, it's not going to work much differently from the > other proposed work-around though - if only qualified references > trigger auto-loading, then this would trigger auto-loading: > > \foo\bar(); > > And this would too: > > use foo\bar; > > bar(); > > But this would not: > > bar(); Yep, that's about the size of it. If I could go back and time and join the discussion at the time of PHP 6 / PHP 5.3, I'd argue for simplifying the name resolution, so the last one was either always the current namespace or always a global name. Pass me that faster-than-light telephone... ;) Regards, -- Rowan Collins [IMSoP]