Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13877 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13262 invoked by uid 1010); 16 Nov 2004 22:36:19 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 12986 invoked from network); 16 Nov 2004 22:36:17 -0000 Received: from unknown (HELO server786.dnslive.net) (66.78.26.27) by pb1.pair.com with SMTP; 16 Nov 2004 22:36:17 -0000 Received: from ip68-8-15-105.sd.sd.cox.net ([68.8.15.105] helo=[192.168.2.36]) by server786.dnslive.net with esmtps (SSLv3:RC4-MD5:128) (Exim 4.43) id 1CUBvs-00032R-QT for internals@lists.php.net; Tue, 16 Nov 2004 17:36:17 -0500 Organization: The Coeus Group To: internals@lists.php.net Date: Tue, 16 Nov 2004 14:35:24 -0800 User-Agent: KMail/1.6.1 References: <200411161154.45169.evan@coeus-group.com> <1752161643.20041116223255@marcus-boerger.de> In-Reply-To: <1752161643.20041116223255@marcus-boerger.de> X-DeCSS-Usage: cat title-key scrambled.vob | decss > clear.vob X-DeCSS-Line-1: #define m(i)(x[i]^s[i+84])<< X-DeCSS-Line-2: unsigned char x[5],y,s[2048];main(n){for(read(0,x,5);read(0,s,n=2048);write(1,s,n))if(s[y=s[13]%8+20]/16%4==1){int i=m(1)17^256+m(0)8,k=m(2)0,j=m(4)17^m(3)9^k*2-k%8^8,a=0,c=26;for(s[y]-=16;--c;j*=2)a=a*2^i&1,i=i/2^j&1<<24;for(j=127;++jy)c+=y=i^i/8^i>>4^i>>12,i=i>>8^y<<17,a^=a>>14,y=a^a*8^a<<6,a=a>>8^y<<9,k=s[j],k="7Wo~'G_\216"[k&7]+2^"cr3sfw6v;*k+>/n."[k>>4]*2^k*257/8,s[j]=k^(k&k*2&34)*6^c+~y;}} MIME-Version: 1.0 Content-Disposition: inline Message-ID: <200411161435.02851.evan@coeus-group.com> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server786.dnslive.net X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - coeus-group.com X-Source: X-Source-Args: X-Source-Dir: Subject: Re: [PHP-DEV] Overloaded class registration From: evan@coeus-group.com (Evan Nemerson) On Tuesday 16 Nov 2004 13:32, Marcus Boerger wrote: > Hello Evan, > > your implementation is wrong, you need to specify the arguments to > __get/__set. Thanks for the reply, but can you be a bit more specific? I'm already specifying num_args and required_num_args (the former of which is what is checked in zend_check_magic_method_implementation()). Setting arg_info seems to have no effect. Here's the code I used to try setting arg_info (apologies if it wraps) for the __set method: fe_set.type = ZEND_INTERNAL_FUNCTION; fe_set.handler = ZEND_FN(fannOO___set); fe_set.function_name = NULL; fe_set.scope = NULL; fe_set.fn_flags = 0; fe_set.prototype = NULL; fe_set.num_args = 2; fe_set.required_num_args = 2; fe_set.arg_info = ecalloc(fe_set.num_args, sizeof(zend_arg_info)); fe_set.pass_rest_by_reference = 0; fe_set.arg_info[0].name = one; fe_set.arg_info[0].name_len = strlen(one); fe_set.arg_info[0].class_name = le_fann_name; fe_set.arg_info[0].class_name_len = strlen(le_fann_name); fe_set.arg_info[0].allow_null = 0; fe_set.arg_info[0].pass_by_reference = 0; fe_set.arg_info[0].return_reference = 0; fe_set.arg_info[0].required_num_args = fe_set.required_num_args; fe_set.arg_info[1].name = two; fe_set.arg_info[1].name_len = strlen(two); fe_set.arg_info[1].class_name = le_fann_name; fe_set.arg_info[1].class_name_len = strlen(le_fann_name); fe_set.arg_info[1].allow_null = 0; fe_set.arg_info[1].pass_by_reference = 0; fe_set.arg_info[1].return_reference = 0; fe_set.arg_info[1].required_num_args = fe_set.required_num_args; > > best regards > marcus > > Tuesday, November 16, 2004, 9:01:25 PM, you wrote: > > Hi everyone, > > > > I noticed recently that both of my extensions (Panda and FANN, both in > > PECL) emit error messages when their __get() and __set() methods are > > registered. The problem seems to be that fptr.common->num_args is always > > 0 in zend_check_magic_method_implementation(), regardless of what I set > > them to prior to registration. > > > > The functions still work perfectly, and valgrind doesn't complain. > > There's just an incredibly annoying error message every time. It's > > entirely possible (if not probable) that it's my code that's wrong, not > > ZE2, but I can't for the life of me figure it out. > > > > The pertinant portion of the code is based on the SOAP extension. The > > source code for the fann extension is at > > http://cvs.sourceforge.net/viewcvs.py/*checkout*/fann/fannphp/fann.c?rev= > >1.13 > > > > I tried pecl-dev last week, and the only suggestion I got was using the > > read_property and write_property callbacks instead of the __get() and > > __post() methods, but I don't really think that's an option. The thread > > is at http://marc.theaimsgroup.com/?l=pecl-dev&m=110012046408453&w=2 > > > > Thanks. > > > > > > -- > > Evan Nemerson > > evan@coeus-group.com > > http://coeusgroup.com/en > > -- > Best regards, > Marcus mailto:helly@php.net -- Evan Nemerson evan@coeus-group.com http://coeusgroup.com/en