Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94575 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28327 invoked from network); 19 Jul 2016 01:58:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jul 2016 01:58:36 -0000 Authentication-Results: pb1.pair.com smtp.mail=jesseschalken@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=jesseschalken@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.52 as permitted sender) X-PHP-List-Original-Sender: jesseschalken@gmail.com X-Host-Fingerprint: 209.85.214.52 mail-it0-f52.google.com Received: from [209.85.214.52] ([209.85.214.52:35298] helo=mail-it0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C1/3C-52781-B498D875 for ; Mon, 18 Jul 2016 21:58:35 -0400 Received: by mail-it0-f52.google.com with SMTP id u186so82262198ita.0 for ; Mon, 18 Jul 2016 18:58:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=DhWnBSU8T3PROGP3WntyCRFkk/ubmHBbNLhqKn/fYkk=; b=TD5iajMlicR6JiiN4D+SXTPt8XT/9PpPkdY22H/3/guCHZm1U1XeSBu7Vg2uC5GGON NKjQsmMbp3cLL4L0BayQ1FzOHV5ytZbNJJk6vTfpTS89JtjDvufboNziLLGK5ThqYlXK AqbMuE9raxu0aQ4AdJfzD1gkNEMD5rVf6UE+NrNf8/s7tyf5A6cHxIyvNebh1/JYR9/Z zmC4IgjgV7K/343qWwS2gpim6j7BG/BLqUKC8MFUG5MvMWyO10bSPqfCOeRmHyfBjg0d oou9CzeJSTIdDxqBQhRHgBhthqb/bymhBKUTglZ8sV1x3XFYv6rzNVohf1YZcV+8aMxy CwMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=DhWnBSU8T3PROGP3WntyCRFkk/ubmHBbNLhqKn/fYkk=; b=XgdIK8zK6a+6aYBmt/gniCLRv1YbhyJn2tdeFXiwHccTtbdI4+q9bbIfQvjGs2eHK3 7eC3teMrvsHhDZ1fCo2WAKAqpoXkYwmf4UL2V/PZtyINBQZ21qZ5D1la9facpXfHdyaB 9t8OeifLxAIYUzeQx5/P4xHo6jfiMP17qFw7RBwi2LA1kxjDOMwFzyrz5FcrS/3E12eQ 9zVkIvsSo+G1acofjZPjWuKn7eCZWTgYtP/bwdhjkOvwQHyC1DxfTN1Z/qPVbP1YCf7p ok6V96sOwWuGDTbPgenpZeZC2LhdzFppexz4kC0nANnthDpURP2S7VibKqp61unA3L66 q2wA== X-Gm-Message-State: ALyK8tJvRMg8uVll4RZ8zeuck5tc6GFgGhejkfbZjl8OKpzcN6dKB8PmYAZCXCdNJyMgTtBzApza8KxOsV8A/g== X-Received: by 10.36.39.77 with SMTP id g74mr18252496ita.51.1468893513013; Mon, 18 Jul 2016 18:58:33 -0700 (PDT) MIME-Version: 1.0 Sender: jesseschalken@gmail.com Received: by 10.79.95.195 with HTTP; Mon, 18 Jul 2016 18:58:32 -0700 (PDT) In-Reply-To: References: Date: Tue, 19 Jul 2016 11:58:32 +1000 X-Google-Sender-Auth: t4MZ5ac9g1QG15toTxzz1O_f378 Message-ID: To: Nikita Popov Cc: Levi Morrison , Rowan Collins , PHP Internals Content-Type: multipart/alternative; boundary=001a11474b8c0e610f0537f36c29 Subject: Re: [PHP-DEV] Idea: Function autoloading using dummy namespaces From: me@jesseschalken.com (Jesse Schalken) --001a11474b8c0e610f0537f36c29 Content-Type: text/plain; charset=UTF-8 On Mon, Jul 18, 2016 at 9:55 AM, Nikita Popov wrote: > > A relaxed variant would only invoke the autoloader once for each > call, assuming that a function that is not loadable at one time will never > become loadable (which is of course a significant restriction). The former > variant would be prohibitively slow. The latter is more realistic, but I > expect it to have non-trivial performance impact nonetheless. > > Is that really a significant restriction? The only difference it would make is for code that expects "namespace Bar { foo(); }" to refer to global function "foo()" at one point in the program, and later to refer to "Bar\foo()" at another point in the program, after "Bar\foo" has become loadable. That kind of temporal coupling with the symbols that happen to be loaded/loadable at a given point in time sounds just awful, and I can't imagine what the use case would be. Considering Option B can cause the introduction of global functions to break code (my previous email), the caching of negative results from the autoloader sounds like the only feasible option. --001a11474b8c0e610f0537f36c29--