Hello All,

Before drafting an RFC I would like to gauge interest in adding:
get_object_constants and get_class_constants

Currently this can only be done through ReflectionClass which is far slower
than retrieving them directly from the constants table.  Some simple
timings show that through reflection retrieving these values is 2-3 times
slower than providing a quick access function for retrieval.

This also fits nicely amongst the current stack of:
get_object_vars, get_class_vars and get_class_methods

These functions are commonly asked about on areas such as StackOverflow (
http://stackoverflow.com/questions/956401/can-i-get-consts-defined-on-a-php-class)
amongst other places on the net.

I have already drafted up a PR with the changes and supplemental data:
https://github.com/php/php-src/pull/292

Regards,

Mike

Reply via email to