Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31281 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34563 invoked by uid 1010); 26 Jul 2007 15:23:14 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 34548 invoked from network); 26 Jul 2007 15:23:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jul 2007 15:23:14 -0000 X-Host-Fingerprint: 83.135.145.129 i53879181.versanet.de Received: from [83.135.145.129] ([83.135.145.129:22938] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CC/55-10081-26CB8A64 for ; Thu, 26 Jul 2007 11:23:14 -0400 Message-ID: To: internals@lists.php.net Date: Thu, 26 Jul 2007 17:23:08 +0200 User-Agent: Thunderbird 2.0.0.5 (Windows/20070716) MIME-Version: 1.0 References: <46981E98.30803@php.net> In-Reply-To: <46981E98.30803@php.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 83.135.145.129 Subject: Re: __call_static() Magic Method From: sebastian.deutsch@9elements.com (Sebastian Deutsch) Hello, where can i find the latest version of your patch? Etienne Kneuss provided me a patch to track from where my class method is called statically. Will they work together? cheers *.sebastian deutsch Sara Golemon schrieb: > Attached is a patch which exports an internals hook in zend_class_entry > for fetching function pointers similar to the object hook get_method() > available to instance methods. > > This patch also exports a userspace hook __call_static() which operates > in the fashion of the current __call() magic method, but for static calls. > > Wez called for some functionality like this a few weeks ago for a COM > wrapper (or something similar), and I noticed there was actually a > comment in the engine about how this should eventually be done anyway... > > Usage example: > > class foo > { > public static function __call_static($fname, $args) > { > echo "foo::{$fname}() called staticly with ", > count($args), " parameters\n"; > } > } > > foo::randomMethod(1,2,3); > > > I considered setting get_static_method to zend_std_get_static_method() > by default (avoiding the if set check during runtime), but all the other > hoooks follow this pattern so I went with consistency. > > If noone comments to the negative, I'll commit next friday (7/20)... > > -Sara >