Re: [PHP-DEV] [RFC] get_debug_type

  108625
February 16, 2020 23:24 mike@newclarity.net (Mike Schinkel)
> On Feb 16, 2020, at 8:15 AM, Mark Randall <marandall@php.net> wrote: > > On 16/02/2020 10:16, Mike Schinkel wrote: >> Why "debug" type? > > I would imagine because it is only really useful in the context of debugging.
JMTCW but I generally think names should describe what something is, not what it can be used for. The former can typically be definitive, the latter is based on perspective and thus both multiple names could apply and for some people the "can be used for" name turns out to be confusing. For example, when I first saw the name I was wondering if it would return some kind of debugging "mode" and was curious if there were more than one mode for debugging. I was hopeful that there was something new about debugging for me to learn.
> There is no reason to ever expose such information to userland.
Hmm. Depending on what you envision, I could definitely see using it in userland. Basically something that merges gettype() and get_class() so that I can get one definitive type for a value and not have to call two functions. I can of course write my own, but my own would not be "standard" and so I would see value in having a standard function for this in core.
> The name is up for debate.
Cool. Though still not exactly sure where you are headed with it since there are few detailed and no code examples the first name that comes to mind for me would be get_real_type(). -Mike
  108626
February 16, 2020 23:28 george.banyard@gmail.com ("G. P. B.")
On Mon, 17 Feb 2020 at 00:25, Mike Schinkel <mike@newclarity.net> wrote:

> > On Feb 16, 2020, at 8:15 AM, Mark Randall <marandall@php.net> wrote: > > The name is up for debate. > > Cool. > > Though still not exactly sure where you are headed with it since there are > few detailed and no code examples the first name that comes to mind for me > would be get_real_type(). > > -Mike >
Erf pls no, I'd rather have something like `get_canonical_type()` George P. Banyard
  108629
February 17, 2020 00:48 mike@newclarity.net (Mike Schinkel)
> On Feb 16, 2020, at 6:28 PM, G. P. B. banyard@gmail.com> wrote: > > Erf pls no, I'd rather have something like `get_canonical_type()`
That works fine too. -Mike P.S. But not sure what "Erf" means, though. '-)
  108644
February 17, 2020 11:42 kalle@php.net (Kalle Sommer Nielsen)
Den man. 17. feb. 2020 kl. 01.25 skrev Mike Schinkel <mike@newclarity.net>:
> Though still not exactly sure where you are headed with it since there are few detailed and no code examples the first name that comes to mind for me would be get_real_type().
"real" is a type in PHP (tho we are phasing that out, see is_real() and the (real)-cast), so that name would most likely make it more confusing to userland. -- regards, Kalle Sommer Nielsen kalle@php.net
  108651
February 17, 2020 22:48 mike@newclarity.net (Mike Schinkel)
> On Feb 17, 2020, at 6:42 AM, Kalle Sommer Nielsen <kalle@php.net> wrote: > > Den man. 17. feb. 2020 kl. 01.25 skrev Mike Schinkel <mike@newclarity.net>: >> Though still not exactly sure where you are headed with it since there are few detailed and no code examples the first name that comes to mind for me would be get_real_type(). > > "real" is a type in PHP (tho we are phasing that out, see is_real() > and the (real)-cast), so that name would most likely make it more > confusing to userland.
Certainly. I picked "real" because of realpath(), but that was just the first thing that came to mind. My intent was to propose using a name describing function vs. envisioned use-case, and others have made good naming suggestions. -Mike