Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10871 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87323 invoked by uid 1010); 2 Jul 2004 13:51:37 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 86179 invoked by uid 1007); 2 Jul 2004 13:51:28 -0000 Message-ID: <20040702135128.86178.qmail@pb1.pair.com> To: internals@lists.php.net Reply-To: "l0t3k" Date: Fri, 2 Jul 2004 09:50:18 -0400 Lines: 28 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Posted-By: 65.80.67.32 Subject: Please confirm behaviour of ZEND_ACC_STATIC From: cshmoove@bellsouth.net ("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. 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