Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64948 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43153 invoked from network); 14 Jan 2013 19:58:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jan 2013 19:58:54 -0000 Authentication-Results: pb1.pair.com smtp.mail=lisachenko.it@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=lisachenko.it@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.171 as permitted sender) X-PHP-List-Original-Sender: lisachenko.it@gmail.com X-Host-Fingerprint: 209.85.220.171 mail-vc0-f171.google.com Received: from [209.85.220.171] ([209.85.220.171:34443] helo=mail-vc0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C0/F8-22727-E7364F05 for ; Mon, 14 Jan 2013 14:58:54 -0500 Received: by mail-vc0-f171.google.com with SMTP id n11so3926238vch.2 for ; Mon, 14 Jan 2013 11:58:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=4Qql64fMfQ8kJ0PdjLhnaE9gnkc2zvF78FPXYy0T/5Q=; b=CpC07/vAVnM0YtlEaKSQDuz3u0XxpkC9EGtAtPeLRBze3zr3lFFx4w6G3EKnZX6A0B ek9+fa6EQPt4Q7OZNpnmEITV8xuH7uM5RRu5ZU7i+MzkTZviTbD2Y9vqgmh+y7yt0QE1 TkqN0uuiOZoAwbgfT26O5vk8faatVMRSSKigsDSdL7BvbfHE8FPFwQRdFZvfs6PJDYv+ qNl0ygVWX3GFOQUAZfhz1NKkHAJIwsmB1YxYYWrr1X5wOg4npmmYLVv6DZCW+aAc9C85 nZfPFl9LNGS3T7FnT99EzbuEYVVL9MSG7xxJiA9qa2hPpqHoYQ54Vn6ZtYJPNoHOOsOA yVWg== MIME-Version: 1.0 Received: by 10.58.222.40 with SMTP id qj8mr106606549vec.36.1358193531326; Mon, 14 Jan 2013 11:58:51 -0800 (PST) Received: by 10.59.6.42 with HTTP; Mon, 14 Jan 2013 11:58:51 -0800 (PST) In-Reply-To: References: Date: Mon, 14 Jan 2013 23:58:51 +0400 Message-ID: To: Anthony Ferrara Cc: Sebastian Krebs , PHP internals list Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [Reflection] Improve logic of ReflectionMethod->invokeArgs() for static methods From: lisachenko.it@gmail.com (Alexander Lissachenko) I do not use static methods, frameworks and applications use them )). I just want to extend logic of class methods in the application with custom behavior (Logging, Caching) and preserve original scope. It's already done for PHP 5.4 with closures and my library works well with any PHP framework. For 5.3 it works only for dynamic methods and static methods without LSB. 2013/1/14 Anthony Ferrara : > Alexander, > >> So, I take the original class, rename it and then create a decorator >> class instead of original class with overridden dynamic and static >> methods. Method in the decorator should make some specific logic and >> then just invokes the original static method with Reflection, but the >> scope should be also correct. > > > I have to ask: *why*? Why are you using static methods like that? It seems > to me that you're trying to use LSB to introduce a form of polymorphism > where it's not really designed for it... Why not just use instances in this > case (which are supported for your use-case)...? > > Anthony