Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124971 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 8A0761ADA72 for ; Fri, 16 Aug 2024 05:58:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1723788002; bh=WwM3ZBBUkL/y611g8qB/cItrbM9eQS51udYCg3ZF76A=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=GzOg1G8LkDuZR0NAw4PL9QJae4hIk13Z/SEZzbshhattDNhLjP0EZR8JzGcxWcax5 f2qYo986F9cOTesEJWgAnXsichFc8IAzQVt2mt0FxdK1xMut5KJibaT3tl/VpNXpfB 0mfX/yY8OlJKPN24yAdq7t+HhYlH0om7qnPQQBZiww0mURhpLdHix+QumlGI9kjvpD X/VuOADPeKaNNHf4QdyltUtoki3JISHndQwu+0pWzfC3CxMz9g6w5Kv307GSslfoGE cJMpqfwByiZmXElJFESwmzBFvQF/s2dy0L2Qwt8qbOjj8iE102XynCTkn4WNhL6KP3 Sfey8rCrQUuvg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1037818007A for ; Fri, 16 Aug 2024 06:00:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DMARC_MISSING,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-yb1-f179.google.com (mail-yb1-f179.google.com [209.85.219.179]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 16 Aug 2024 05:59:58 +0000 (UTC) Received: by mail-yb1-f179.google.com with SMTP id 3f1490d57ef6-dfe43dca3bfso1809868276.0 for ; Thu, 15 Aug 2024 22:58:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20230601.gappssmtp.com; s=20230601; t=1723787891; x=1724392691; darn=lists.php.net; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=3/SnUMJYMR2D8KV0TgxI/yCToG01cSh1FXQ4eJ5fTVQ=; b=S8IdSY6lsZ1EELny2VsB37hQ5VbNHvodTVRxo59k4ztwM7q+i9jKXtfVcxUJmvz8Ym uqCfY0Bt3TWkZV9qx5UDsu812/vV2sQAoJVGcmWi4BJyWoxb8Dv4euBx0j/OFyBxIwyM x5byOzRBg8gjc8WO+uh+fyOwYR1KfRf+YOsi87RpRFTCTXtVeq+PaGgjCIW1J1OmFs4/ BvV2WJTARFQcMd/4gkYJoDXmcPtJpFcYHTHwnHkLYUqcDGM+sRybSP9Q1t4IUU0+eeGF i35TF25cUg41sh6c+BVx521HMXseIUZXFjHLo2XyCj5yiNbD8l+lu+vEeeb6rG7R5Md/ vjfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723787891; x=1724392691; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3/SnUMJYMR2D8KV0TgxI/yCToG01cSh1FXQ4eJ5fTVQ=; b=m9gcWOE4ZjDcXScPPVpKOB8BV/e4OkvSG+5NtiiXWL4JmLHl4C0R0h+zH15jnwHUBV 6pcN/KrIlwC/JuL3c4/HgbhDmcclJSdz9wcNNdx6AhrACOJ+C1ZOGhujyKtMyHQjSNBN qMgRyBtKl3pP0IEqXzNHO+5792C4q9wbw5MymM67iQkjhVyVS1N5IHP/Um/EXQUqvgC+ GR6PhZz0e/lQyU3/MzAUzjnOSyprfqMWIv79+nj3XHIWipuUfInLBdLofmHZLYO4Z/jB URceYCDmP5vhzu+riWetUaIt33Gtf/ao9sOmA60qqphL6C3yQEazbImJv9vIsys7puYq /UVg== X-Gm-Message-State: AOJu0YzgigbIcd3DgcxpTMcXj7binQmRSmKud4H6ovNPD70kknR5rVq0 VVikNhUt/PDPo8dBLtk5pQyUtovNbdApZDqcm+19lfUglx63OKzQShWkHI4oeiohnlKcKDn/M0v f+ZY= X-Google-Smtp-Source: AGHT+IFIYnMQ9bTbBV9tvDxf/rxaLwI9Gf92KKGlrxZwJpZ9dWWTlWSlu7x+7y7t76XGBrxjnvCpPQ== X-Received: by 2002:a25:d08d:0:b0:e11:baf6:a323 with SMTP id 3f1490d57ef6-e11baf6a9bemr1596874276.39.1723787890803; Thu, 15 Aug 2024 22:58:10 -0700 (PDT) Received: from smtpclient.apple (c-98-252-216-111.hsd1.ga.comcast.net. [98.252.216.111]) by smtp.gmail.com with ESMTPSA id 3f1490d57ef6-e1171e68e4dsm630944276.27.2024.08.15.22.58.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Aug 2024 22:58:10 -0700 (PDT) Message-ID: <9D0EF844-08E6-4854-B156-86958D2D996D@newclarity.net> Content-Type: multipart/alternative; boundary="Apple-Mail=_D5682A9D-DF63-4526-B78A-B09C190D602F" Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.8\)) Subject: Re: [PHP-DEV] [DISCUSSION] Class Constant Enums? Date: Fri, 16 Aug 2024 01:58:10 -0400 In-Reply-To: <34548342633f1d87b2fc77c643bd895a18f71b66.camel@ageofdream.com> Cc: internals@lists.php.net To: Nick Lockheart References: <34548342633f1d87b2fc77c643bd895a18f71b66.camel@ageofdream.com> X-Mailer: Apple Mail (2.3696.120.41.1.8) From: mike@newclarity.net (Mike Schinkel) --Apple-Mail=_D5682A9D-DF63-4526-B78A-B09C190D602F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Aug 15, 2024, at 9:37 PM, Nick Lockheart = wrote: >=20 > Hi, >=20 > Is there any interest in having enums as class constants? > I'm often finding cases where I would like to have an enum inside of a > class, but don't want a free-floating enum that's basically like > another class. >=20 > When dealing with state, it's nice to have a human readable const to > represent that state, but I always feel like they should be grouped > together. Yes, I would very much like that. -Mike P.S. See related: https://externals.io/message/107995 = --Apple-Mail=_D5682A9D-DF63-4526-B78A-B09C190D602F Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii
On = Aug 15, 2024, at 9:37 PM, Nick Lockheart <lists@ageofdream.com> wrote:

Hi,
Is there any interest in having enums as = class constants?
I'm often finding cases where I would like to have an = enum inside of a
class, but don't want a free-floating = enum that's basically like
another class.

When dealing with state, it's nice to have a human readable = const to
represent that state, but I always feel like they = should be grouped
together.

Yes, I would = very much like that.

-Mike

= --Apple-Mail=_D5682A9D-DF63-4526-B78A-B09C190D602F--