Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57542 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42641 invoked from network); 28 Jan 2012 20:43:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Jan 2012 20:43:06 -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:56095] helo=mail-qy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 06/62-09011-8DD542F4 for ; Sat, 28 Jan 2012 15:43:05 -0500 Received: by qcsr14 with SMTP id r14so1504870qcs.29 for ; Sat, 28 Jan 2012 12:43:01 -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=pbKTXEpnpnWXmqVTeueDwzaG5eGcrZT68wD96oZQBv0=; b=VypaQJQazEd5hOUl5kSGGblzRu0+pRV8kPgjI4xngq8FH1Ad2nGig8W0hDav8LPwih gG7HalAiULnVFBXORSI3MKyIsycO0nqpdCzkYrFV9GThd+9hkJBvLw7UBu1nRfsFH4ND Qaxb3SrbvdkcCLjxT56tUtxyt+7VRJgrMEF6Y= MIME-Version: 1.0 Received: by 10.229.77.76 with SMTP id f12mr1217107qck.91.1327783381374; Sat, 28 Jan 2012 12:43:01 -0800 (PST) Received: by 10.229.242.1 with HTTP; Sat, 28 Jan 2012 12:43:01 -0800 (PST) In-Reply-To: References: Date: Sat, 28 Jan 2012 20:43:01 +0000 Message-ID: To: Justin Martin Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] PHP_SESSION_* constant values From: dragoonis@gmail.com (Paul Dragoonis) On Sat, Jan 28, 2012 at 7:17 PM, Justin Martin wrote: > Hello everyone, > > For the result of session_status(), the corresponding constants for the > sessions state are > > =A0- PHP_SESSION_DISABLED =3D 0 > =A0- PHP_SESSION_NONE =3D 1 > =A0- PHP_SESSION_ACTIVE =3D 2 > > I'd like to suggest we change these values to > > =A0- PHP_SESSION_DISABLED =3D -1 > =A0- PHP_SESSION_NONE =3D 0 > =A0- PHP_SESSION_ACTIVE =3D 1 > > This way, one can do if(session_status()) to check if there is an active > session, rather than having to compare the result to a constant. > > Any objections? I believe comparing the value against a constant, is always more readable than wondering what "truthy" means. if(session_status() =3D=3D=3D PHP_SESSION_ACTIVE) is much self-documenting than the proposed change. Therefore I object to this change. - Paul > > Thanks, > Justin Martin > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >