Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59444 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87077 invoked from network); 7 Apr 2012 21:27:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Apr 2012 21:27:15 -0000 Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.211.66 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.211.66 config.schlueters.de Received: from [217.114.211.66] ([217.114.211.66:42733] helo=config.schlueters.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A9/C2-23111-231B08F4 for ; Sat, 07 Apr 2012 17:27:15 -0400 Received: from [192.168.2.230] (unknown [188.174.218.247]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by config.schlueters.de (Postfix) with ESMTPSA id 4E514603BE; Sat, 7 Apr 2012 23:27:10 +0200 (CEST) To: Matthew Hernandez Cc: PHP Internals In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Date: Sat, 07 Apr 2012 23:27:06 +0200 Message-ID: <1333834026.4220.6.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] how do you create a private property as an array in a class From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) Hi, On Sat, 2012-04-07 at 11:23 -0700, Matthew Hernandez wrote: > This is my first extension I'm working on. I'm trying to make a class > available to the user space with 1 private property that is an array. The first question is: Why? - Why add the overhead of creating such an array if it is private? In most cases it is better to extend the zend_object in C (struct my_object { zend_object inner; type some_data;}) to hold private data. If you want to show it in var_dump or a debugger you could implement a debug_info hook. johannes