Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68698 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79945 invoked from network); 30 Aug 2013 06:51:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Aug 2013 06:51:38 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.192.175 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.192.175 mail-pd0-f175.google.com Received: from [209.85.192.175] ([209.85.192.175:62637] helo=mail-pd0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7F/D1-64695-9F040225 for ; Fri, 30 Aug 2013 02:51:38 -0400 Received: by mail-pd0-f175.google.com with SMTP id q10so1474801pdj.34 for ; Thu, 29 Aug 2013 23:51:35 -0700 (PDT) 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:date :message-id:subject:from:to:cc:content-type; bh=PNjtrUjrSLk1xZsiz0nwVNAI705SKfmnyqdlp5Nu5UM=; b=LnJnwIYm6IOWkPYqCeIL3auJvBrij/W7xFzoSbW+3i279IVCY7Zr1W1WG4P6LLL3lj ixYzo6HMVkOEKD5FPfXB8gV/Rpl3xd182Y8xll1xx7MnD67LwGyNqKEPX5P+ZoEhJ6Na ie+wKd/2N5/nxQjfkth/t4IE3xIDipcb/bqRnv5MegwbP3/EyLZ0+oFXWw2vLE/o29hk jycd1Yv797rh1B815upJnEel5PDACbrz9FKvKVFp4YUYEpltaHOL9P27MifHh/IBfVJz nktH4lQQQ0m0hb7cldMyvjLZl/ROZNVZCBJNO8574pFe/t2KW/kOviLeFsAmD9DGUxF+ CE/g== X-Gm-Message-State: ALoCoQkHwukrYNNVNEq/16fizAkdSUUR4wa+7oZOOTJhzknnX1zH4LmJkeT1J+oL64xbF1gUZxtF MIME-Version: 1.0 X-Received: by 10.66.242.17 with SMTP id wm17mr8908476pac.102.1377845494966; Thu, 29 Aug 2013 23:51:34 -0700 (PDT) Sender: php@golemon.com Received: by 10.70.24.33 with HTTP; Thu, 29 Aug 2013 23:51:34 -0700 (PDT) X-Originating-IP: [173.252.71.189] In-Reply-To: <5220262A.6040702@sugarcrm.com> References: <5220262A.6040702@sugarcrm.com> Date: Thu, 29 Aug 2013 23:51:34 -0700 X-Google-Sender-Auth: vEhPmoMvudyo1YhihTYeHGxwlNQ Message-ID: To: Stas Malyshev Cc: Anthony Ferrara , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=047d7b111915487b2c04e524a775 Subject: Re: [PHP-DEV] [DRAFT] [RFC] Function autoloading From: pollita@php.net (Sara Golemon) --047d7b111915487b2c04e524a775 Content-Type: text/plain; charset=ISO-8859-1 > I think it is an unnecessary complication. Classes fit autoloader > paradigm nicely, since the usual pattern is one class per one file > (actually recommended in PSR), so it is easy to establish one-to-one > automatic mapping between classes and files (also recommended in the > PSR). But for functions nobody does this. This means that to implement > function autoloader one will need to have a complicated and fragile > logic (since there's no way to ensure this logic would be in sync with > actual content of files containing multiple functions). > > I disagree on the basis that namespaced functions/constants *do* fit the same autoloading paradigm. Moreover, since this replaces a simple hash lookup with additional two > function calls (and also other operations included in those) everywhere > in the engine, it will also have performance impact of one of the most > frequently used operations in the engine - function calls - while > providing absolutely no benefit for 100% of existing code and 99.99% of > future code. > > Those function calls would only kick in if the function/constant wasn't already defined, which will be the exception case, so perf isn't a strong argument. > Putting autoloading of different entities into one function makes very > little sense to me - why would the same code load both classes and > functions? How would it do that besides ugly switch that just stuffs two > completely different logic pieces into one function for no reason? The > example given in the RFC is certainly not what anybody would actually > want their autoloaders to do, so I fail to see any case for doing it and > for putting loading more than one entity into one function (that given > that autoloading function would be desirable at all, which it still > doesn't seem so for me). > > That I agree with 100%. -Sara --047d7b111915487b2c04e524a775--