Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57985 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 25575 invoked from network); 23 Feb 2012 20:16:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Feb 2012 20:16:24 -0000 Authentication-Results: pb1.pair.com smtp.mail=keisial@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=keisial@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.170 as permitted sender) X-PHP-List-Original-Sender: keisial@gmail.com X-Host-Fingerprint: 209.85.212.170 mail-wi0-f170.google.com Received: from [209.85.212.170] ([209.85.212.170:36928] helo=mail-wi0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F4/67-18992-79E964F4 for ; Thu, 23 Feb 2012 15:16:24 -0500 Received: by wibhm4 with SMTP id hm4so1185563wib.29 for ; Thu, 23 Feb 2012 12:16:20 -0800 (PST) Received-SPF: pass (google.com: domain of keisial@gmail.com designates 10.216.138.7 as permitted sender) client-ip=10.216.138.7; Authentication-Results: mr.google.com; spf=pass (google.com: domain of keisial@gmail.com designates 10.216.138.7 as permitted sender) smtp.mail=keisial@gmail.com; dkim=pass header.i=keisial@gmail.com Received: from mr.google.com ([10.216.138.7]) by 10.216.138.7 with SMTP id z7mr1627729wei.16.1330028180665 (num_hops = 1); Thu, 23 Feb 2012 12:16:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=TFuwSm3/3mbE1cmQUffiObNTA8KtLZdWqqmplxVmAcU=; b=eqF6ULeheTAbGLV62uJ0EbTz/TTm7V3UQLw3Z2BKOfGWNqWdGcqYANzDoc7HbQgX4W geeUDincDx9GNyQCXzxT8BtGPE2FqJJtEKR7VRjyR6lVJk3oL+FMR4xY9eBL0dfuBVer zgUEbJ5nTV7q/JQE6/6ifepGaWlHwEtBxSzEY= Received: by 10.216.138.7 with SMTP id z7mr1324965wei.16.1330028180614; Thu, 23 Feb 2012 12:16:20 -0800 (PST) Received: from [192.168.1.26] ([80.28.66.11]) by mx.google.com with ESMTPS id m8sm11336575wia.11.2012.02.23.12.16.18 (version=SSLv3 cipher=OTHER); Thu, 23 Feb 2012 12:16:19 -0800 (PST) Message-ID: <4F469FB7.7040802@gmail.com> Date: Thu, 23 Feb 2012 21:21:11 +0100 User-Agent: Thunderbird MIME-Version: 1.0 To: Sebastian Krebs CC: PHP internals list References: <4F455C96.50706@gmail.com> <4F455E91.2060408@googlemail.com> <4F4570D6.8040003@gmail.com> <4F457597.3060405@sugarcrm.com> <4F468D09.7070004@gmail.com> <4F468E1B.5030800@googlemail.com> In-Reply-To: <4F468E1B.5030800@googlemail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Enum proposal (yet another) From: keisial@gmail.com (=?ISO-8859-1?Q?=C1ngel_Gonz=E1lez?=) I don't see your point, Sebastian. > And > > | $studipNamedVariable = Databases::Mysql; > | // ... much code > | database_select($stupidNamedVariable, $sql); > > is better? The problem here seems to be more the developer, that > avoids the use of constants, then less the missing enums. You can obviously do weird things, as with in any feature. In this case you bring up, I see little sense in passing enums in variables, unless that comes itself from a parameter for that function, or comes from an external source, like a configuration data. > If you use a constant like > > | Databases::Mysql = 1024; > > the call > > | database_select(Database::IDontExists, $sql); > > will fail too. Other examples, that supports type hints, can be found > in other mails around here. Yes. With a parser error as IDontExists doesn't belong to Database enum. How does it relate with assigning 1024 to Databases::Mysql ?