Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94545 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38976 invoked from network); 18 Jul 2016 04:18:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jul 2016 04:18:55 -0000 Authentication-Results: pb1.pair.com header.from=jesseschalken@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=jesseschalken@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.179 as permitted sender) X-PHP-List-Original-Sender: jesseschalken@gmail.com X-Host-Fingerprint: 209.85.223.179 mail-io0-f179.google.com Received: from [209.85.223.179] ([209.85.223.179:35734] helo=mail-io0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AD/20-35561-EA85C875 for ; Mon, 18 Jul 2016 00:18:54 -0400 Received: by mail-io0-f179.google.com with SMTP id m101so149572023ioi.2 for ; Sun, 17 Jul 2016 21:18:54 -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=8uDHVMZCkJ1+HF/iJjW6slqxn0Kbb0HHj+qQ0xlIEiE=; b=dTAnLDGKZ4hZwsT3Y/gHaB5GXfOywZcPG2JULmCgMzfyolY9tDBS8HkD1Dmhq6N4wG tAFO6+ySsKDvgwZ2E/uP664ZJBG3AzGjydmy96aYo2embHhuWUPZGwXyV+bEDlWBCReq VdHWVGKiQz4SwLjTjR/q/+iO+4MnBmpjH/EOZwYiHOAUqho9EinIRS1YHxic6DjSKXc6 F4CiaRSybKKFBP4pj++HG5hfHV1RKv3+8BU+mlLcsdrYHpqgJv1idk6OXM7nhz/tCH/5 XISTTuYX345ZIBIscpXM6xQ5Gmnxut1PcFpJpv/jVvsydniVAmLOVzosXZDQt/Eq1jku Quow== 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=8uDHVMZCkJ1+HF/iJjW6slqxn0Kbb0HHj+qQ0xlIEiE=; b=RyNVz4jKRpupkHF58gZEKetZWl37Oef9CjaGG8HJLK/brz3Qqm8J/No5bbjUXRCxCp y4fPXck8Zl3OdZNM0u4Ximk9PsXjv8kAr3o5efTQx8hucQHKeIlJnFWtGzNl/6a+FPJf Hj1OvTfQHk+Txhsl6Av8c74soA7KJL9DmHV9KGwQjDjLHnT27x395SeNp4XBd6QGad/D bKQX6Nh9hpIQhAaJgcLhrYgrBkjiSbROgasOOOHAMlBEMWPvuYHtoOlS9CiTK2raAFFL kH/ruzbeib3IG6iBMIYW53gDQWYcyc4O56TZfciaGlFl6qQ4UfIGz/cUOSpS8lvOvCWj rPtg== X-Gm-Message-State: ALyK8tJzgVu88WaoxfwV+kcqk6ilQ+ctxT98p65e2EwCGZCLw7I7HyLTYS4YiOhmCi9p2YQGtBDKZlALlvjMIg== X-Received: by 10.107.172.70 with SMTP id v67mr30549690ioe.31.1468815531396; Sun, 17 Jul 2016 21:18:51 -0700 (PDT) MIME-Version: 1.0 Sender: jesseschalken@gmail.com Received: by 10.79.95.195 with HTTP; Sun, 17 Jul 2016 21:18:50 -0700 (PDT) In-Reply-To: References: Date: Mon, 18 Jul 2016 14:18:50 +1000 X-Google-Sender-Auth: 2DXg12zowzDpn6n2r_lW9weI-74 Message-ID: To: Nikita Popov Cc: Rowan Collins , PHP Internals Content-Type: multipart/alternative; boundary=94eb2c05ab28fd551d0537e143f1 Subject: Re: [PHP-DEV] Idea: Function autoloading using dummy namespaces From: me@jesseschalken.com (Jesse Schalken) --94eb2c05ab28fd551d0537e143f1 Content-Type: text/plain; charset=UTF-8 On Mon, Jul 18, 2016 at 4:53 AM, Nikita Popov wrote: > > Option B: foo() in namespace Bar will > a) Check if Bar\foo() exists > b) Otherwise check if foo() exists > c) Otherwise try to load 'Bar\foo' > d) Otherwise try to load 'foo' > e) If all fails, throw. > > This avoids the autoloading overhead when calling functions from the global > namespace. However this also means that you cannot autoload a function with > the same name as a global function through an unqualified call. > > Doesn't this mean that an innocent introduction of global function "foo()" could break "namespace Bar { foo(); }", since it would then refer to the global function "foo" (step b) and "Bar\foo" would not be autoloaded (step c)? --94eb2c05ab28fd551d0537e143f1--