Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110457 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 66185 invoked from network); 10 Jun 2020 05:48:44 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Jun 2020 05:48:44 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id EF6DD1804B7 for ; Tue, 9 Jun 2020 21:32:33 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-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,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 9 Jun 2020 21:32:33 -0700 (PDT) Received: by mail-io1-f44.google.com with SMTP id q8so688932iow.7 for ; Tue, 09 Jun 2020 21:32:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=MfhBlvZc3lRKAk/be7Po9rQbGyzggMZLBM3VNutzD04=; b=N+MpBOkYxhLK1CXX4dZdwJe29BGUdo2qrqGKRyeVMuWxX82ZyM8fwVsQp/QWIO3Tol s8ehsX9lOAmHCSd/YPP2ln214H+dM60HZvQ48q4Vu+HuVX7AJWKtabM6E8wn4dOzYo3B wYhVsr9cCMcdu83SjZWh0wm82eU/l0Oqt1DycvKfS7B/NM7m4Gvr9OXL39ke/2RltdL9 ZU4gBL0ZxzqhRnkcDJed/dtS4w1LaAePvNbGrSE6UfIhkYs2HH/Cs+3ShAH4Wk4vzN9k LTUo/KkKbk/8XL8PN80tyl1qjgWwM141/VPKLDCOMuLhot5Ocf4QMpxnFDE576CpQDtp hA2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=MfhBlvZc3lRKAk/be7Po9rQbGyzggMZLBM3VNutzD04=; b=smBPF3YPpY6N8oAQoHX9t3Qz/Ru1HBtiYQ22NrXDrok0esT3IAHQ1oAFatJfZqKtba Uw1iinw+PYyH38dPaoo4tVsdLBOJOsineFbj8oUpfSCk9E1w34Ev0icdZ3os8ZkvX6Ev MxJzW1scebj2inzd2pAEjDaSAn5l+TwQBeLiXevdE7o0ah99eNEp0OvjVGvSuMdysN9Y Bp4B8NQi2Bv2mA2rv0PpfuqrjOSMgIplYuMQ+BKDgO4Ff5RQtARZt4wHLtXZ/TWFoWvj ujX5CiINB22wG1Htva5gmS7XzMMpbw3DhlmDsXBfi4+muw/nQnGd4Mz+QTaaNCSb3Nkc ck+Q== X-Gm-Message-State: AOAM533rkv+S9PSPuz7osm7ycrvVRv4HlgLjXZBR1kHzHWFhLb/MDFRP E6ufIyWF22WFQNR7fVtNHL07858uTKoN2qtSWMiQZdzZoNo= X-Google-Smtp-Source: ABdhPJxtIT9eAnecWoG/ZjJx2u9pr4l1O292PufA9vTVdhplBAvHOoR+yxULztsznLrBKBm+t30jxDuALI/6gpdo4g8= X-Received: by 2002:a5d:914d:: with SMTP id y13mr1543615ioq.48.1591763550267; Tue, 09 Jun 2020 21:32:30 -0700 (PDT) MIME-Version: 1.0 Date: Tue, 9 Jun 2020 23:32:19 -0500 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000faf0b105a7b354b5" Subject: Revisiting proposal for addition of `get_class_constants()` From: troy.mccabe@gmail.com (Troy McCabe) --000000000000faf0b105a7b354b5 Content-Type: text/plain; charset="UTF-8" Hi All, With several functions (`str_contains()`, `str_[starts|ends]_with()`) added for PHP8 to make things more clear, it feels like a good time to revisit the multiple requests to add `get_class_constants(string $class): array`. This would allow userland code to retrieve constants in the same way as properties / methods, instead of having to use reflection for constants and built-in functions for properties / methods. In addition to uniformity, a bit of fiddling shows close to half the time for 10k executions I'm willing to implement if there's interest (curiosity got the best of me for the aforementioned fiddling) Looking forward to your thoughts, Thanks! Troy McCabe --000000000000faf0b105a7b354b5--