Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66281 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13987 invoked from network); 27 Feb 2013 17:16:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Feb 2013 17:16:16 -0000 Authentication-Results: pb1.pair.com smtp.mail=pencap@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pencap@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.169 as permitted sender) X-PHP-List-Original-Sender: pencap@gmail.com X-Host-Fingerprint: 209.85.223.169 mail-ie0-f169.google.com Received: from [209.85.223.169] ([209.85.223.169:61902] helo=mail-ie0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 15/82-33355-F5F3E215 for ; Wed, 27 Feb 2013 12:16:15 -0500 Received: by mail-ie0-f169.google.com with SMTP id 13so904154iea.14 for ; Wed, 27 Feb 2013 09:16:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=iSD0KZWEfVrpCn6AagY0MeDiIRxZNHDunEJmnJjwbFQ=; b=IA48hND5Zy1BI13q+wW7ij+6s3MlHkL0GZQ7zUtA4ped7Lsbltpn1ZJnXptMZ8fBL2 qYwWN1VBA7IfNEtXO/VlpKF3FKjUviATG3UPI/7E6GsuG4wbAuo7VTuKZdAfMw58RNvS Ys/Noqq/E3zhL3iXr6BvMVGGQrfm1jt23OuQJLOg1+ZO89RbDRlj92SMGmuODOcHs/9U Sb8W7YJJ9asBHWFNZfJrlJtkzcB+dYCuv9EXfp6syaZZw/88FUpo7KWvagW1QHc7NN4p GQgRSvExgI7pI0Xqc8ArYih7bSVeX1KcGAaBpB83fbnPisl3BsZ1ZPXQS7zkctisAZq8 Thwg== MIME-Version: 1.0 X-Received: by 10.50.41.200 with SMTP id h8mr7099332igl.14.1361985372886; Wed, 27 Feb 2013 09:16:12 -0800 (PST) Received: by 10.50.85.232 with HTTP; Wed, 27 Feb 2013 09:16:12 -0800 (PST) In-Reply-To: <512E3DAD.90505@googlemail.com> References: <512DB820.6060908@sugarcrm.com> <512E1E1B.6020007@googlemail.com> <512E2278.3070406@2e-systems.com> <512E3DAD.90505@googlemail.com> Date: Wed, 27 Feb 2013 09:16:12 -0800 Message-ID: To: PHP Developers Mailing List Content-Type: multipart/alternative; boundary=14dae9340ad157718c04d6b7ee23 Subject: Re: [PHP-DEV] Add get_object_constants and get_class_constants From: pencap@gmail.com (Mike Willbanks) --14dae9340ad157718c04d6b7ee23 Content-Type: text/plain; charset=UTF-8 > I am simply suggesting an alternative to using Reflection whereas: >> >> get_class_constants([object|**string]); >> get_object_constants([object])**; >> >> Do we need both; probably not; the first would likely do. >> > > +1 for the first one only > > > Am 27.02.2013 16:12, Analyst (Frank Schenk) trolled: > > bitmask class to shuffle around with class constants >> > > shuffle bits around with clearly named constants: > http://php.net/manual/en/**language.operators.bitwise.php > https://github.com/symfony/**symfony/blob/master/src/** > Symfony/Component/Security/**Acl/Permission/MaskBuilder.php This part of the example shows this in practice: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Security/Acl/Permission/MaskBuilder.php#L192 You can see where it is using the reflection class to grab constants. These are the types of use cases where this becomes useful; now depending on how many times this is done in a code base really depends on how useful the function is over using the reflection class itself. - Mike --14dae9340ad157718c04d6b7ee23--