php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #30398 get_class_methods too greedy
Submitted: 2004-10-11 17:31 UTC Modified: 2004-10-13 00:46 UTC
From: epowell at visi dot com Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: 5.* OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: epowell at visi dot com
New email:
PHP Version: OS:

 

 [2004-10-11 17:31 UTC] epowell at visi dot com
Description:
------------
PHP5 introduces private, 
protected, and public object methods, but there is no 
functionality to list just the private or just the 
public methods in an object.  The get_class_methods() 
function will return all method names, regardless of 
protection level.

I would like to suggest either overloading the 
get_class_methods() function to take a protection level 
argument (for example, 
$array=get_class_methods($object,'private)) or creation 
of a set of functions to do the same 
(get_class_public_methods(), 
get_class_private_methods()).

Yes, I could use the Reflection API, but that's serious 
overkill...


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-11 19:52 UTC] helly@php.net
Use Reflection API instead.
 [2004-10-12 16:18 UTC] epowell at visi dot com
Well, heck, why not rip out all class functions then?  
Reflection API cures all!  No need for silly little 
things like functions when we can jump through hoops 
instead.

You could at least explain why you're refusing to 
implement a few lines of C code.
 [2004-10-12 16:21 UTC] epowell at visi dot com
Well, heck, why not rip out all class functions then?  
Reflection API cures all!  No need for silly little 
things like functions when we can jump through hoops 
instead.

You could at least explain why you're refusing to 
implement a few lines of C code.
 [2004-10-13 00:46 UTC] helly@php.net
because we have the functionality already. We shouldn't have those get_class_*() in the first place because we have reflection. But we need them for BC with 4 were we didn't hadd reflection.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 11:01:37 2024 UTC