Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125728 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 044291A00BD for ; Wed, 2 Oct 2024 12:11:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1727871227; bh=VuPKUxOQak/4X0fb06DlAyIpxAgOtbPoK0yZiEF49wU=; h=References:In-Reply-To:From:Date:Subject:To:From; b=X80f/EzRL28YjgEdsQPA9j8QQybn8SCfz7ZUMaHiHLqJ96Vwpdk7vUKg0Dh6yaKMi bc6gb0MNs6LGAt9UG7rWngXFdQMssUqhZt4oAy67SMPe4a5bHv5JHcCHTp6Ekd2FUl Ga4hdX5SgrSG42UM7VCdcUQ5N4zZIWLyCzb3E904aSCgIjJbLghn2HuoMxsyDX2id8 +7xkY81XGPz3sLHRKc/qcyBBJmuQjXGY2eK2HT3Gw70XBp5IAMIII9ciRJfHbzNaka H+cF7ArTlYZ29IYNR3NqKjpTSTHEJiYzIH9dLKkrDCqolik3orWwhrM8Kaxq7lSTlK kysZPAC4k8waw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 803111801DD for ; Wed, 2 Oct 2024 12:13:46 +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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-yb1-f178.google.com (mail-yb1-f178.google.com [209.85.219.178]) (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 ; Wed, 2 Oct 2024 12:13:46 +0000 (UTC) Received: by mail-yb1-f178.google.com with SMTP id 3f1490d57ef6-e026a2238d8so6234078276.0 for ; Wed, 02 Oct 2024 05:11:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727871092; x=1728475892; darn=lists.php.net; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=YlVUZmBpdWFy5uRMLwzsfnAwZ3X4lI7Vt2FEB5JcJVQ=; b=AYCmUOz1R/9hmmd7j6o/bpFIb7qaR/FM0PKK3tGSpHN6wMCRpgZpWBmj33dAny4Q8I qqpnKfxO7AetxsQOxmXGOPMuweyuurABWTFRFKoYK3Uo66h4TnoWNQ3IF4uiVo0NskWT zg+WgEpunmhCnWOjdxvpCazNjNcdbgh5TVxu6ROjhaa8fzirRdCU3kXOXCfcq9aLAMQ/ QouI5wc6ojEMnSlRFtNvdnxw9AF8WwzM24e3Vfx52DTir0CfitQEYXA9YpjRMWY+g8Iu LQPY09y57yQrxDV8PArY1IfY624Iy/bRpCndEQdWgS4/9thWlCirlafcFNd3PDYUjfrz 6obg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727871092; x=1728475892; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YlVUZmBpdWFy5uRMLwzsfnAwZ3X4lI7Vt2FEB5JcJVQ=; b=l6JwpfpdGOW5BBHsfoYqsQprsb/d83+X16DNGUzmoumnqbF9rjNt1d+5p7SoQktSn4 NDvXcKTh+7RKpAKcdlvXGSNYZl9zECjJSwYD3orVg5B68XuC99BgEs+u1gEhBu5ws8EU sVDF60L2kotofD6Uj1HREHKRL6AAKc2bclhHrYusZCu8cyMr6xFc7lSc7DXUpp+UqwyD 1TOINGfHE7oQs2lbhJ5Iyw4aHKfPtJbYqdv/ONwvD2LZDMshnjeZSnAW+VNsjHsniIss NC5VZHbLn2nf4iBzqodDTM5CSyN9OBoFGYfAk1L1Qxqy20yyqC/e2W7Xfr1CPLtoLgG+ yeew== X-Gm-Message-State: AOJu0YxVEEymYfNLIqHI/Fdz76SEhUBtKrcGE/kBkUuRWGL5nEHzXzAu JR2iQfjFEHq34h4kJxBUOUAJyXPDeK67bJhTGPHL+qQWA93JrM9jrIpRSWG64hFcyMb04I9xFfb OQapXIAEtvtMaE5nnxUOroNqv9k8pi+h+ X-Google-Smtp-Source: AGHT+IHQdv3Sn5jyiWo4RuHZxUildv1mGz25OwR2P7Blq+RmfYSWVuEPzzAfXGVVeLhzwZ8mt97rNpghyCyBC4yd3oM= X-Received: by 2002:a05:690c:d8a:b0:6b0:e813:753b with SMTP id 00721157ae682-6e2a2e2720cmr23452937b3.38.1727871091665; Wed, 02 Oct 2024 05:11:31 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <66FC7B9F.5070906@adviesenzo.nl> In-Reply-To: Date: Wed, 2 Oct 2024 15:11:13 +0300 Message-ID: Subject: Re: [PHP-DEV] [RFC] [Discussion] Add get_declared_enums() function To: PHP internals Content-Type: multipart/alternative; boundary="000000000000a2f4ec06237d569e" From: drealecs@gmail.com (=?UTF-8?Q?Alexandru_P=C4=83tr=C4=83nescu?=) --000000000000a2f4ec06237d569e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Oct 2, 2024 at 10:20=E2=80=AFAM Alexandru P=C4=83tr=C4=83nescu wrote: > > One would be able to get only the enums by using something like: > ```php > function get_declared_enums_only() { > return array_diff(get_declared_classes(), get_declared_enums()); > } > ``` > > Sorry, I somehow got confused, and I meant to say "to get only the class that are not enums" and it would be like this: ``` function get_declared_class_without_enum() { return array_diff(get_declared_classes(), get_declared_enums()); } ``` -- Alex --000000000000a2f4ec06237d569e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Wed, Oct 2, 2024 at 10:20=E2=80=AFAM A= lexandru P=C4=83tr=C4=83nescu <dre= alecs@gmail.com> wrote:

One would be able to get only the enums by using something = like:
```php
function get_declared_enums_only() {
=C2=A0 = =C2=A0 return array_diff(get_declared_classes(), get_declared_enums());
= }
```


S= orry, I somehow got confused, and I meant to say "to get only the clas= s that are not enums" and it would be like this:
```
function get_declared_class_without_enum() {
=C2=A0 =C2=A0 return arr= ay_diff(get_declared_classes(), get_declared_enums());
}
`= ``

-- Alex=C2=A0
--000000000000a2f4ec06237d569e--