php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #43315 Additional Class inspection
Submitted: 2007-11-16 17:30 UTC Modified: 2007-11-16 18:08 UTC
From: artktec at gmail dot com Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 5.2.5 OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: artktec at gmail dot com
New email:
PHP Version: OS:

 

 [2007-11-16 17:30 UTC] artktec at gmail dot com
Description:
------------
There are four native php-functions for inspection of class/object methods and variables. Those are:

get_class_vars()
get_class_methods()
get_object_vars()
get_object_methods()

I think you could round out this inspection by having native-functions for getting class/object constants. Thus, I propose:

get_class_constants($class_name)
get_object_constants($object)

I understand that you can use reflection, but I still think it would be a nice addition to round out the functions. It would also lead to logical programming techniques.

Nick


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-11-16 18:08 UTC] johannes@php.net
These functions are mainly legacy stuff from the time before we had reflection, nowadays we try to have a better structure, this means that reflection is the place for such stuff.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 13:01:31 2024 UTC