Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38126 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2593 invoked from network); 10 Jun 2008 05:46:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jun 2008 05:46:18 -0000 Authentication-Results: pb1.pair.com header.from=greg@chiaraquartet.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=greg@chiaraquartet.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain chiaraquartet.net from 38.99.98.18 cause and error) X-PHP-List-Original-Sender: greg@chiaraquartet.net X-Host-Fingerprint: 38.99.98.18 beast.bluga.net Linux 2.6 Received: from [38.99.98.18] ([38.99.98.18:48405] helo=mail.bluga.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CF/E2-17320-9251E484 for ; Tue, 10 Jun 2008 01:46:18 -0400 Received: from mail.bluga.net (localhost.localdomain [127.0.0.1]) by mail.bluga.net (Postfix) with ESMTP id 045D0C129B5; Mon, 9 Jun 2008 22:46:21 -0700 (MST) Received: from [192.168.0.106] (CPE-76-84-4-101.neb.res.rr.com [76.84.4.101]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.bluga.net (Postfix) with ESMTP id 734DFC129B4; Mon, 9 Jun 2008 22:46:20 -0700 (MST) Message-ID: <484E152D.8050005@chiaraquartet.net> Date: Tue, 10 Jun 2008 00:46:21 -0500 User-Agent: Thunderbird 2.0.0.14 (X11/20080505) MIME-Version: 1.0 To: christoph@christophdorn.com CC: internals@lists.php.net References: <484E0318.2040405@christophdorn.com> In-Reply-To: <484E0318.2040405@christophdorn.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Subject: Re: Calling original function from an overloaded function From: greg@chiaraquartet.net (Gregory Beaver) Christoph Dorn wrote: > I have been looking at xdebug and have figured out how to overload a > function. As a test I have overloaded the var_dump function. > > Now how do I call the original var_dump function from my implementation? > Borrowing from OO terminology I have subclassed the var_dump method, now > I want to call parent::var_dump() from my subclass. > > Also how does overloading work when two extensions overload the same > function? Can this be done? Is there some sort of order? Can I let the > other extension overload the function and then overload the function > from the other extension? > > Any pointers would be greatly appreciated. Hi, phar does exactly what you're describing, this is all encapsulated in func_interceptors.c: http://cvs.php.net/viewvc.cgi/php-src/ext/phar/func_interceptors.c?revision=1.20.2.1&content-type=text%2Fplain&pathrev=1.20.2.1 Greg