Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94544 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30130 invoked from network); 18 Jul 2016 00:50:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jul 2016 00:50:44 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.45 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.220.45 mail-pa0-f45.google.com Received: from [209.85.220.45] ([209.85.220.45:36290] helo=mail-pa0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9A/2E-31884-4E72C875 for ; Sun, 17 Jul 2016 20:50:44 -0400 Received: by mail-pa0-f45.google.com with SMTP id pp5so48414424pac.3 for ; Sun, 17 Jul 2016 17:50:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=DTq0WXNs7JwK7YQdg7WJGq0D01Rk+w3pPGg2BC068cc=; b=ITjBGgNB0mroeVyQztDSTfDv47llfMNtOh4AOlponLDDp2BWunFTdVRlbHGuhYZayl cHc1TU0GFUzY1x7R4+5ZwkhfScYrbK/S3eCV1Psywbl6NwIdEMuLKWaLOGglZgnpZEsH SmTRWEOUOa1LjvdKkzf7bFkNe/NkaPJacJ7u+THyeNRCvhr8e6GaXR9oShb7urRu72DO pkJqCjJ2/SmArh4sOC9pdDUgeOHD/T6XzNFE4SDc+9BTDkN8HWhyYLYKbxFNZHmjJ/Ux iN8swnorVhaqLCVYxGjkDHxMoJyUwW+fkq9+yFaEWPbZnpcFzPr9cl3BOoN1+WN+tOjL vkXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=DTq0WXNs7JwK7YQdg7WJGq0D01Rk+w3pPGg2BC068cc=; b=enOiPAtTFD5tKd6wlQqdmSv/Kfy4l+Nsfq7mZZaqBtEQsSt3ZOuPbSoeG6Az9DsMSA udXsdoBZ0pSTT1R7zPvouBFa5V+7YfGOWpQKoDjgRpA755aLrk+lQy1AXzUMyQm6aZlh aYJCBTjuSNElSqQfpq0zbxdQBpcXEjWlutO+082Q6NQBvbMp21dwiR09WAzs3bj120LM Pb5dDwbCOul/n0DtDdNQ+pX/prmqtI0M1YXLZJHMe3lK70ggGTxnxnQy3KBtPOOP4bqZ 13V0cLj/sXUpCwVrDI3ei68RIVt6ZdxPS/u8nKEcGCet4R2bfBsvOKvQnRXp7wwKLeK1 Sw8g== X-Gm-Message-State: ALyK8tJMaYnjwzSRMBsLpMcky4qdxs7xLCJT0rS7J1qALEV51dQs7gRIphP+NfqJtqJ0jw== X-Received: by 10.66.216.41 with SMTP id on9mr52550607pac.86.1468803041277; Sun, 17 Jul 2016 17:50:41 -0700 (PDT) Received: from [192.168.2.100] (76-220-46-95.lightspeed.sntcca.sbcglobal.net. [76.220.46.95]) by smtp.gmail.com with ESMTPSA id fj19sm114196pab.37.2016.07.17.17.50.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Jul 2016 17:50:40 -0700 (PDT) To: Rowan Collins , PHP Internals References: Message-ID: <3567286a-e942-1551-c300-663a50b0f484@gmail.com> Date: Sun, 17 Jul 2016 17:50:38 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Idea: Function autoloading using dummy namespaces From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > How about an alternative approach where a function inside a namespace > can be autoloaded using the existing callback, by using a reserved > namespace segment? So to autoload function "foo\bar()", the engine would > construct a string like "__function\foo\bar" or "foo\__function\bar", > and pass that to the registered autoloader stack. Magic out-of-domain values usually are bad design, and lead to a lot of trouble since now the system needs to deal with two sets of assumptions instead of one. I wouldn't recommend doing it. -- Stas Malyshev smalyshev@gmail.com