Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:30904 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74772 invoked by uid 1010); 14 Jul 2007 06:36:12 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 74754 invoked from network); 14 Jul 2007 06:36:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jul 2007 06:36:12 -0000 Authentication-Results: pb1.pair.com header.from=jani.taskinen@sci.fi; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=jani.taskinen@sci.fi; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain sci.fi from 63.208.196.171 cause and error) X-PHP-List-Original-Sender: jani.taskinen@sci.fi X-Host-Fingerprint: 63.208.196.171 outbound.mailhop.org FreeBSD 4.6-4.9 Received: from [63.208.196.171] ([63.208.196.171:1444] helo=outbound.mailhop.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 90/2D-11631-BDE68964 for ; Sat, 14 Jul 2007 02:36:11 -0400 Received: from cs136054.pp.htv.fi ([213.243.136.54] helo=[192.168.1.100]) by outbound.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1I9bEe-0008dH-Je; Sat, 14 Jul 2007 02:36:08 -0400 X-MHO-User: U2FsdGVkX19Y5yfvO4zSQZzFZ5L96zKkDdVORAL/vZU= X-Mail-Handler: MailHop Outbound by DynDNS X-Originating-IP: 213.243.136.54 X-Report-Abuse-To: abuse@dyndns.com (see http://www.mailhop.org/outbound/abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/yrfrOflyRUxOLxzOLZw4aRfToXJgtNYU= Message-ID: <46986EDB.8030507@sci.fi> Date: Sat, 14 Jul 2007 09:36:11 +0300 Reply-To: jani.taskinen@iki.fi User-Agent: Thunderbird 1.5.0.12 (Windows/20070509) MIME-Version: 1.0 To: Sara Golemon CC: internals@lists.php.net 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 Subject: Re: [PHP-DEV] __call_static() Magic Method From: jani.taskinen@sci.fi (Jani Taskinen) Sara Golemon kirjoitti: > 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)... As long as you MFH, I don't mind. --Jani