Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10876 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23707 invoked by uid 1010); 2 Jul 2004 18:14:29 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 22694 invoked from network); 2 Jul 2004 18:14:21 -0000 Received: from unknown (HELO mx.thebrainroom.net) (69.55.226.195) by pb1.pair.com with SMTP; 2 Jul 2004 18:14:21 -0000 Received: by mx.thebrainroom.net (Postfix, from userid 517) id 87BD214880CD; Fri, 2 Jul 2004 11:14:20 -0700 (PDT) Received: from BAUMBART (p508EB86C.dip.t-dialin.net [80.142.184.108]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by mx.thebrainroom.net (Postfix) with ESMTP id D7D8214880CB; Fri, 2 Jul 2004 11:14:16 -0700 (PDT) Date: Fri, 2 Jul 2004 20:14:24 +0200 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <857306709.20040702201424@marcus-boerger.de> To: l0t3k Cc: internals@lists.php.net In-Reply-To: <20040702135128.86178.qmail@pb1.pair.com> References: <20040702135128.86178.qmail@pb1.pair.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on jc.thebrainroom.net X-Spam-Status: No, hits=0.8 required=5.0 tests=PRIORITY_NO_NAME autolearn=no version=2.63 X-Spam-Level: X-TBR-Filter: Virus scanned and defanged Subject: Re: [PHP-DEV] Please confirm behaviour of ZEND_ACC_STATIC From: helly@php.net (Marcus Boerger) Hello l0t3k, never ever mix static and non static methods! The only reason this is possible is for having BC for old bullshit concepts. Apart from that use ZEND_ACC_ALLOW_STATIC if you really want that behavior but before you do think twice and again and then again if there is no correct way... marcus Friday, July 2, 2004, 3:50:18 PM, you wrote: > in my extension, i have a class which has methods which work slightly > differently depending on whether or not they are called statically. > as an example : > $original = new UnicodeString("HELLO WORLD","utf8"); > $lower = UnicodeString::toLowerCase($original); /* returns a new copy > */ > $lower1 = $original->toLowerCase(); /* original is lowercased. return a > reference */ > the latter is for efficiency. imagine chains like > print_r($original->reverse()->toTitleCase()->split(" ")); /* no > intermediaries created work on $original*/ > while the former allows for transformations without affecting the original > string. > since the method can behave statically, it is marked as ZEND_ACC_STATIC. > however it appears that once marked as such, > getThis() always reports NULL. i've confirmed that marking it as non static > cause the object to be properly passed. > is this a WAD. if so, is it possible (at least for internal functions) for a > method to be called statically as well as in an object context ? > l0t3k -- Best regards, Marcus mailto:helly@php.net