Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22638 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78551 invoked by uid 1010); 1 Apr 2006 17:04:18 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 78536 invoked from network); 1 Apr 2006 17:04:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Apr 2006 17:04:18 -0000 X-Host-Fingerprint: 194.109.193.120 unknown Linux 2.5 (sometimes 2.4) (4) Received: from ([194.109.193.120:41586] helo=mx1.moulin.nl) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 5A/57-09123-192BE244 for ; Sat, 01 Apr 2006 12:04:17 -0500 Received: from localhost (localhost [127.0.0.1]) by mx1.moulin.nl (Postfix) with ESMTP id 8F5FB1A4E0A; Sat, 1 Apr 2006 19:04:20 +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 06857-14; Sat, 1 Apr 2006 19:04:17 +0200 (CEST) Received: from [10.0.13.55] (ip129-15-211-87.adsl2.versatel.nl [87.211.15.129]) by mx1.moulin.nl (Postfix) with ESMTP id A11661A4E03; Sat, 1 Apr 2006 19:04:17 +0200 (CEST) Message-ID: <442EB289.4050304@iamjochem.com> Date: Sat, 01 Apr 2006 19:04:09 +0200 User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Matthew C. Kavanagh" Cc: "Unknown W. Brackets" , internals@lists.php.net References: <442DCE06.8070307@iamjochem.com> <442E3611.6070306@iamjochem.com> <442E3CD1.9030106@teh.ath.cx> In-Reply-To: <442E3CD1.9030106@teh.ath.cx> 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] Re: __set() / __get() : limitation and/or unintentional behavoiur? From: jochem@iamjochem.com (Jochem Maas) Matthew C. Kavanagh wrote: > Write your __set to not allow arrays to be set, and make arrays within > your object private or objects with __set in their own right. > > You could in fact create a "CustomArray" or something and allow > CustomArrays to be __set'd in your object, then control their contents > with CustomArray->__set(). > > There's no problem here. I don't even want to set arrays as overloaded properties and if I did I could come up with another hundred workarounds to avoid the problem - the ability to workaround a problem doesn't mean there is not a problem. I posed the question after trying to help someone with a question posed on php-generals ... and finding that the behaviour was actually rather strange and unintuitive (imho); Its still trivial to make php segfault when using __get()/__set() - I really don't care what I do with php, a segfault should never occur, at worst I get a nice FATAL ERROR telling what an idiot I have been... my tests with APC 3.0.10 show that despite the best efforts of mr. Lerdorf et al it is still segfaults intermittently when using [lots of?] objects (of varying complexity) that use __get()/__set()/__call()/etc - the last 24 hours lead me to suspect that not APC but the engine itself is the 'bad guy' ... unfortunately I don't have the C skills to test that theory.