Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54599 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40618 invoked from network); 14 Aug 2011 21:50:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Aug 2011 21:50:10 -0000 Authentication-Results: pb1.pair.com header.from=sebastian.krebs.berlin@googlemail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=sebastian.krebs.berlin@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.214.42 as permitted sender) X-PHP-List-Original-Sender: sebastian.krebs.berlin@googlemail.com X-Host-Fingerprint: 209.85.214.42 mail-bw0-f42.google.com Received: from [209.85.214.42] ([209.85.214.42:62190] helo=mail-bw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9C/A5-05730-113484E4 for ; Sun, 14 Aug 2011 17:50:10 -0400 Received: by bkd19 with SMTP id 19so2762662bkd.29 for ; Sun, 14 Aug 2011 14:50:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=message-id:date:from:reply-to:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=EZ66xQebggw/JOPFSg/YcFBtKoor++ZtLuiVWxWkpu0=; b=muFHDcYKuLNcHEuqHQ8p89B9BYxO13XihrzO+ToYnWJmNoM1cK3McU3hXBZo2egAmx DdLXPUeJdj83KLV3LiRBVh77NaeXjgV+Pw9SWviuko/jZ40UgkV1+JLF+Gd9xeWQRDGT 1WO8jHD42xIYAt/P3p87HdtTQFw5YnTJJoUKM= Received: by 10.204.167.1 with SMTP id o1mr195895bky.352.1313358606572; Sun, 14 Aug 2011 14:50:06 -0700 (PDT) Received: from [192.168.24.2] (91-64-205-130-dynip.superkabel.de [91.64.205.130]) by mx.google.com with ESMTPS id z23sm1371741bks.10.2011.08.14.14.50.05 (version=SSLv3 cipher=OTHER); Sun, 14 Aug 2011 14:50:06 -0700 (PDT) Message-ID: <4E48430D.6070409@googlemail.com> Date: Sun, 14 Aug 2011 23:50:05 +0200 Reply-To: sebastian.krebs.berlin@googlemail.com User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110617 Thunderbird/3.1.11 MIME-Version: 1.0 To: "internals@lists.php.net" References: <4E481136.3090508@sugarcrm.com> <4E483284.4010100@googlemail.com> <4E4838E1.3000006@sugarcrm.com> In-Reply-To: <4E4838E1.3000006@sugarcrm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Function autoloading through spl_autoload* From: sebastian.krebs.berlin@googlemail.com (Sebastian Krebs) Hi, Am 14.08.2011 23:06, schrieb Stas Malyshev: > Hi! > > On 8/14/11 1:39 PM, Sebastian Krebs wrote: >> Counterquestion: Why shouldn't I use functions? They exists, they are > > Because if you want to use functions of similar nature organized in a > package, that's what classes are used for. When I must use classes are for packaging functions (that aren't functions anymore, when I make methods out of them), what are namespaces for? I'm just curious ^^ > You want to do something that > goes contrary to how language is designed and then you want language to > change to fit your wrong usage. I don't see how it's good for the language. I just want to use functions. Whats wrong with that? Really: Thats all. >> discussed to get removed at all. It feels a little bit weird to me, that >> I need to explain, why one wants to use functions, that are part of the > > Please don't distort my words - nobody asked you why you need to use > functions in general. I asked why you don't use mechanisms for grouping > functions that exist in the language and work just fine with existing > semantics and instead want new semantics that has its own problems. Its not (only) about grouping functions, its about using custom functions at all. Grouping things is always a good idea and with namespaces (not classes) it is already possible in a very clean and easy way. There is no need to misuse OOP for that. As far as I can see there is absolutely nothing new here. That functions/constants should be covered by autoloading is the only thing I would like to see in one future release. >> language since ever. And (on the other hand) static methods are imo just >> something different. > > How different? Static methods are (static) methods and functions are functions. Classes can get extended [1] and have a state and such. In short: Both methods and functions come from two different paradigms (OOP and procedural/functional). Just saying "static methods are just grouped functions" is a little bit to less and will always feel like a hack to me. PHP calls itself "multiparadigm", but the prodecural part feels very neglected over the time. Regards, Sebastian [1] Yes, I know, I can mark a class as "final", but this keyword is imo the most useless keyword ever ;)