Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20036 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91154 invoked by uid 1010); 15 Nov 2005 23:54:05 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 91139 invoked from network); 15 Nov 2005 23:54:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Nov 2005 23:54:05 -0000 X-Host-Fingerprint: 216.27.17.157 mail.preation.com Linux 2.4/2.6 Received: from ([216.27.17.157:45815] helo=ford.preationoffice.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 63/28-07637-D157A734 for ; Tue, 15 Nov 2005 18:54:05 -0500 Received: from [192.168.2.55] (uslec-66-255-35-66.cust.uslec.net [66.255.35.66]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by ford.preationoffice.com (Postfix) with ESMTP id BDCB29CB125 for ; Tue, 15 Nov 2005 16:17:37 -0500 (EST) Reply-To: acox@broadwick.com To: internals@lists.php.net Content-Type: text/plain Organization: Broadwick Date: Tue, 15 Nov 2005 16:16:54 -0500 Message-ID: <1132089414.7822.14.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 7bit Subject: Overriding Default Functions From: acox@broadwick.com (Alan Cox) Hello - Is there a way to build an extension that overrides the default behavior of a built-in PHP function? Would it be possible to add an extension that removes a PHP function, so that I could redefine it in my PHP code? What I want to do is override the time calculations. We are running unit tests on a testing server that are dependent on time. For instance, there is one behavior before the 15th of the month and another one on or after the 15th. I'm not able to change the system time, since this testing server is used by a lot of people. What I'd like to be able to do is load a module in the unit test that makes it so that a custom time() function is used. This time() function wouldn't look at the system clock for the time. Thanks for your help. Alan