Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:23235 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86850 invoked by uid 1010); 10 May 2006 23:15:11 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 86835 invoked from network); 10 May 2006 23:15:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 May 2006 23:15:11 -0000 X-PHP-List-Original-Sender: jochem@iamjochem.com X-Host-Fingerprint: 194.109.193.121 mx1.moulin.nl Linux 2.5 (sometimes 2.4) (4) Received: from ([194.109.193.121:36752] helo=mx1.moulin.nl) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 79/30-19568-EF372644 for ; Wed, 10 May 2006 19:15:10 -0400 Received: from localhost (localhost [127.0.0.1]) by mx1.moulin.nl (Postfix) with ESMTP id A3F241D0F45; Thu, 11 May 2006 01:15:06 +0200 (CEST) Received: from mx1.moulin.nl ([127.0.0.1]) by localhost (moulin [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 25657-12; Thu, 11 May 2006 01:15:04 +0200 (CEST) Received: from [10.0.13.54] (ip129-15-211-87.adsl2.versatel.nl [87.211.15.129]) by mx1.moulin.nl (Postfix) with ESMTP id 43A5A15CBBB; Thu, 11 May 2006 01:15:04 +0200 (CEST) Message-ID: <446273F7.2090702@iamjochem.com> Date: Thu, 11 May 2006 01:15:03 +0200 User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Antony Dovgal CC: Ralph Schindler , internals@lists.php.net References: <446222C8.3090101@smashlabs.com> <44623E75.4070304@zend.com> In-Reply-To: <44623E75.4070304@zend.com> X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at moulin.nl Subject: Re: [PHP-DEV] PHP6 OOP compiler feature question / request From: jochem@iamjochem.com (Jochem Maas) Antony, I believe Ralph was using isset() and unset() purely as arbitrary examples, e.g: class TestReservedKeywordMethods { function unset() { echo "unset
"; } function echo() { echo "echo
"; } function empty() { echo "empty
"; } } $test = new TestReservedKeywordMethods(); $test->unset(); $test->echo(); $test->empty(); PS: the underlying example does work, which gives me the feeling that it not so much an architechural limitation but rather a performance issue with regard to doing extra checks as to the context of an encoutered T_UNSET (for example) to determine whether it's okay, but I'm guessing really - (and it's probably is not exactly what Ralph is looking for): class TestReservedKeywordMethods { function __call($m) { echo "$m
"; } } $test = new TestReservedKeywordMethods(); $test->unset(); $test->echo(); $test->empty(); Antony Dovgal wrote: > > __isset() and __unset() methods are what you're looking for. > They are available since 5.1.0. > > See http://www.php.net/manual/en/language.oop5.overloading.php > > On 10.05.2006 21:28, Ralph Schindler wrote: > >> Architectural restrictions aside, is it far off to ask if something >> like this could be possible in PHP6: >> >> > >> class TestReservedKeywordMethods >> { >> public $value = "2"; >> >> public function isset() >> { >> if (is_null($this->value)) >> return false; >> else >> return true; >> } >> >> public function unset() >> { >> $this->value = 0; >> } >> >> } >> >> $test = new TestReservedKeywordMethods(); >> $test->isset(); >> $test->unset(); >> >> ?> >> > >