Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:25659 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29236 invoked by uid 1010); 13 Sep 2006 11:50:16 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 29218 invoked from network); 13 Sep 2006 11:50:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Sep 2006 11:50:15 -0000 X-Host-Fingerprint: 217.79.190.163 r163.red.fastwebserver.de Received: from [217.79.190.163] ([217.79.190.163:15919] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3F/B9-55513-570F7054 for ; Wed, 13 Sep 2006 07:50:15 -0400 To: internals@lists.php.net,danhen@email.de Date: Wed, 13 Sep 2006 13:50:07 +0200 Message-ID: <20060913135007.3294bd5f@pierre-u64> In-Reply-To: <533144034@web.de> References: <533144034@web.de> Reply-To: pierre.php@gmail.com X-Newsreader: Sylpheed-Claws 2.1.1 (GTK+ 2.8.20; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Posted-By: 217.79.190.163 Subject: Re: [PHP-DEV] PHP5 extensions: using existing functionnames as method names From: pierre.php@gmail.com (Pierre) On Wed, 13 Sep 2006 11:35:16 +0200 danhen@email.de wrote: > ...Just forgot to CC... > >you can use any function name as method name without a clash. you > >just cannot use language constructs that aren't real functions like > >"empty", "echo" or "require" as method names. > > >this question better belongs to php-general, btw. > > Sorry if I didn't made myself clear enough. I'm talking about > C-extensions. I've tried to implement the PHP_METHOD(class, xyz). It > compiles fine, but in runtime "PHP Warning: cannot redeclare xyz..." > will appaer. It is possible to name a method like an existing function, I'm not sure what you are doing exactly but it works here. When your class is called zip and you have a function called zip_open, it will conflict with the function name when you build against php < 5.2.0. It is fixed in 5.2 and a work around exists, see ext/zip for an example. -- Pierre