Re: Add parameter user_only to get_declared_classes(interfaces/traits)

From: Date: Fri, 22 Jun 2012 19:04:49 +0000
Subject: Re: Add parameter user_only to get_declared_classes(interfaces/traits)
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-60939@lists.php.net to get a copy of this message
On Fri, Jun 22, 2012 at 6:25 PM, Laruence <laruence@php.net> wrote: > Hi internalers: > >      there comes a FR, #62343 > https://bugs.php.net/bug.php?id=62343 > >      the bug self is about class alias,  but it also metioned a new > parameter $user_only to get_declared_classes. > >      the FR makes sense to me,  for now,  get_defined_functions 's > return will points which functions are internal, and which is user > defined. > >      but get_declared_classes etc doesn't. > >      so I made a patch > > https://bugs.php.net/patch-display.php?bug_id=62343&patch=bug62343.phpt&revision=latest > >      yes, the patch have some room for improving,  like promote the > condition (ce->type == ZEND_USER_CLASS) out of the iterating :) > >      for now, I just what to see what do you think about this idea? > :)  (hope I made my point clear) > Why not use something like get_defined_functions()'s return : a double array of [internal] => array, [user] => array ? It would just make the get_defined_functions()'s API more consistent IMO. We could embrace the [ bool $categorize = false ] API from get_defined_constants() as well , the goal would be to take this bug as an entry point to standardize those functions' API without BBC Julien.P

« previous php.internals (#60939) next »