Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65323 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60476 invoked from network); 29 Jan 2013 08:09:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jan 2013 08:09:37 -0000 Authentication-Results: pb1.pair.com header.from=php@bof.de; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=brianofish@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.83.42 as permitted sender) X-PHP-List-Original-Sender: brianofish@gmail.com X-Host-Fingerprint: 74.125.83.42 mail-ee0-f42.google.com Received: from [74.125.83.42] ([74.125.83.42:61349] helo=mail-ee0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7B/96-28517-0C387015 for ; Tue, 29 Jan 2013 03:09:36 -0500 Received: by mail-ee0-f42.google.com with SMTP id b47so75962eek.15 for ; Tue, 29 Jan 2013 00:09:33 -0800 (PST) X-Received: by 10.14.4.194 with SMTP id 42mr837731eej.35.1359446973256; Tue, 29 Jan 2013 00:09:33 -0800 (PST) Received: from desk22.localnet (makemake.locanto.info. [213.172.110.14]) by mx.google.com with ESMTPS id 44sm19446080eek.5.2013.01.29.00.09.31 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 29 Jan 2013 00:09:32 -0800 (PST) To: internals@lists.php.net Cc: Stas Malyshev , Alan Knowles Date: Tue, 29 Jan 2013 09:09:30 +0100 Message-ID: <3093187.NhbdQjFCsl@desk22> User-Agent: KMail/4.9.5 (Linux/3.4.11-2.16-desktop; KDE/4.9.5; x86_64; ; ) In-Reply-To: <51076233.2040507@sugarcrm.com> References: <51074873.5090600@roojs.com> <51076233.2040507@sugarcrm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [PHP-DEV] [VOTE] Deprecate and remove calls from incompatible context (example of real usage that will break) From: php@bof.de (Patrick Schaaf) On Monday 28 January 2013 21:46:27 Stas Malyshev wrote: > > I understand that there's a tendency to use OO as > a neat way to namespace global functions and autoload them, but that's > not how it is supposed to work. I've seen that sentiment against using static methods several times now, and it always falls short of mentioning the third ingredient it brings to the table: inheritance. In our internal development we often use static-method-only classes, converting stuff previously required and global in that namespace-like-with- autoload fashion, and most of the time this _additionally_ permits us to refactor some conditional spaghetti mess into a small-set-of-subclasses inheritance setup that makes the "fundamental" conditions stand out a lot more clearly than sprinkling conditionals all over the place. To my thinking, using just classes and static methods is absolutely fine OO, simply considering each class to be a singleton object I do not need to instantiate at all. Regarding the discussion at hand (that $this thing) I wasn't even aware of the old behaviour, and factoring common code in our small-set-of-subclasses approach was the #1 reason to switch to PHP 5.4 some month ago, so that we could use traits for that. best regards Patrick