Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56952 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50288 invoked from network); 19 Dec 2011 20:50:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Dec 2011 20:50:35 -0000 Authentication-Results: pb1.pair.com smtp.mail=dragoonis@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dragoonis@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.170 as permitted sender) X-PHP-List-Original-Sender: dragoonis@gmail.com X-Host-Fingerprint: 209.85.216.170 mail-qy0-f170.google.com Received: from [209.85.216.170] ([209.85.216.170:59979] helo=mail-qy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CB/C1-38867-A93AFEE4 for ; Mon, 19 Dec 2011 15:50:35 -0500 Received: by qcsd16 with SMTP id d16so3588093qcs.29 for ; Mon, 19 Dec 2011 12:50:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=Nfoad8+vwt8HI2dAr37YnqxSKfqVYDC2JwpEuN8wUEk=; b=fPFx5S0vYnD/gmFON2qxzQkTADwX+EDmZ0BVCaBOhhqn4hdXP6C8aZ2ZiJnVjPsIcK bF2nlVoPDIBabmjOHftYFzYLiyP1rjhdMxDSDPQHMVfrxoSdVnmYN9V8TLXIr9zjvZGw QvsUsPIkazIc5j0M5YLJ3oWMnzEEdgLdvomIk= MIME-Version: 1.0 Received: by 10.224.39.81 with SMTP id f17mr27656198qae.63.1324327831362; Mon, 19 Dec 2011 12:50:31 -0800 (PST) Received: by 10.229.39.72 with HTTP; Mon, 19 Dec 2011 12:50:31 -0800 (PST) In-Reply-To: <4EEFA2EF.10303@gmail.com> References: <4EEF9C79.4090104@gmail.com> <4EEFA2EF.10303@gmail.com> Date: Mon, 19 Dec 2011 20:50:31 +0000 Message-ID: To: =?ISO-8859-1?Q?=C1ngel_Gonz=E1lez?= Cc: "Barbu Paul Gh." , internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Constant arrays From: dragoonis@gmail.com (Paul Dragoonis) 2011/12/19 =C1ngel Gonz=E1lez : > On 19/12/11 21:23, Paul Dragoonis wrote: >> Barbu, >> >> This is how constants work in all viable languages such as C/++. > I disagree. In C you can have: > const data foo[] =3D { { "Data1", 2 }, { "Data2", 78 } }; Agreed, i was more thinking of #define (not const), when setting up values such as 'MAX_LEN', being a typical use case for PHP. > > It's not unusual in php to have a complex structure that won't change > in a variable. It should be an array, but as array is not allowed as > content, > you need to leave it as a static variable that you won't never change. >