Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10874 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73908 invoked by uid 1010); 2 Jul 2004 14:51:51 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 72482 invoked from network); 2 Jul 2004 14:51:33 -0000 Received: from unknown (HELO iko.gotobg.net) (80.168.8.116) by pb1.pair.com with SMTP; 2 Jul 2004 14:51:33 -0000 Received: from cpanel by iko.gotobg.net with local (Exim 4.34) id 1BgPO4-0000MW-PR; Fri, 02 Jul 2004 17:51:36 +0300 Received: from 217.230.28.21 ([217.230.28.21]) by hristov.com (IMP) with HTTP for ; Fri, 2 Jul 2004 17:51:36 +0300 Message-ID: <1088779896.40e57678ac7d8@hristov.com> Date: Fri, 2 Jul 2004 17:51:36 +0300 To: l0t3k Cc: internals@lists.php.net References: <20040702135128.86178.qmail@pb1.pair.com> In-Reply-To: <20040702135128.86178.qmail@pb1.pair.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.2 X-Originating-IP: 217.230.28.21 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - iko.gotobg.net X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [32001 32001] / [47 12] X-AntiAbuse: Sender Address Domain - hristov.com X-Source: X-Source-Args: X-Source-Dir: Subject: Re: [PHP-DEV] Please confirm behaviour of ZEND_ACC_STATIC From: php@hristov.com (Andrey Hristov) Quoting l0t3k : > 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. Yepp, I have experienced this and forced myself to add methodNameS (the S is for static) method to have static calls available. > 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 > andrey