Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21448 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49232 invoked by uid 1010); 8 Jan 2006 22:00:11 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 49217 invoked from network); 8 Jan 2006 22:00:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Jan 2006 22:00:11 -0000 X-Host-Fingerprint: 202.63.61.242 cust3058.vic01.dataco.com.au Received: from ([202.63.61.242:17790] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id F9/6B-06465-86B81C34 for ; Sun, 08 Jan 2006 17:00:08 -0500 Message-ID: To: internals@lists.php.net Date: Mon, 09 Jan 2006 09:00:41 +1100 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 References: <31.AA.06465.0C74FB34@pb1.pair.com> <7.0.1.0.2.20060108171105.063406b0@zend.com> In-Reply-To: <7.0.1.0.2.20060108171105.063406b0@zend.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Posted-By: 202.63.61.242 Subject: Re: [PHP-DEV] 16-bit reference count in PHP 4's zval From: t.starling@physics.unimelb.edu.au (Tim Starling) Zeev Suraski wrote: > Tim, > > Your analysis was correct until the last sentence - PHP surely does > support arrays with more than 64K entries. It just doesn't support the > same entry being linked from more than 64K locations (which is much, > much more rare occurrence). Well yes, I was just stirring. It's more common than you might think though. My own case was somewhat similar to this: name = $name; } } $cache = array(); for ( $i=0; $i<100000; $i++) { $cache[] = new CacheEntry( "Cache entry $i" ); } ?> ...which will segfault on exit due to the excess references to the empty array object created for the initialisation of the unused member variable $stuff. Generally speaking, arrays of objects with initialised but unused member variables will cause problems. Our code (MediaWiki) has plenty of such arrays, the reason we don't see this more often is because the arrays usually contain less than 64K entries. The size of the arrays depend on user input. -- Tim Starling