Re: Add get_object_constants and get_class_constants

From: Date: Wed, 27 Feb 2013 17:16:12 +0000
Subject: Re: Add get_object_constants and get_class_constants
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-66281@lists.php.net to get a copy of this message
> 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<http://php.net/manual/en/language.operators.bitwise.php> > https://github.com/symfony/**symfony/blob/master/src/** > > Symfony/Component/Security/**Acl/Permission/MaskBuilder.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

« previous php.internals (#66281) next »