Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:14751 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61688 invoked by uid 1010); 9 Feb 2005 15:57:04 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 61672 invoked by uid 1007); 9 Feb 2005 15:57:04 -0000 Message-ID: <20050209155704.61669.qmail@lists.php.net> To: internals@lists.php.net References: <20050209055745.928.qmail@web50206.mail.yahoo.com> Date: Wed, 9 Feb 2005 07:57:04 -0800 Lines: 22 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original X-Posted-By: 64.142.6.231 Subject: Re: intercepting function calls From: pollita@php.net ("Sara Golemon") > Is it possible to intercept a function call (user > space or built-in) in the Zend Engine and execute user > space code before/after the function call? > Yes, you can do this by way of a Zend extension (not a PHP extension mind you). The parts of Zend/zend_extensions.h you'll want to pay attention to are: typedef void (*fcall_begin_handler_func_t)(zend_op_array *op_array); typedef void (*fcall_end_handler_func_t)(zend_op_array *op_array); struct _zend_extension { ... fcall_begin_handler_func_t fcall_begin_handler; fcall_end_handler_func_t fcall_end_handler; ... }; -Sara