Re: [PHP-DEV] [VOTE] Object-based token_get_all() alternative

This is only part of a thread. view whole thread
  108994
March 12, 2020 11:07 come.chilliet@fusiondirectory.org (=?ISO-8859-1?Q?C=F4me?= Chilliet)
Le mercredi 11 mars 2020, 10:59:19 CET Larry Garfield a écrit :
> I forget who it was but someone on the list a while back offered a heuristic of "__toString should be used iff there is one and only one logical string representation of a value, because the value is conceptually just a string with extra metadata on it". > > That sounds like a really solid heuristic to me. In this case, I think yes, ->text is the only reasonable thing to produce for __toString().
Yes that was my reasoning, a token is essentially a substring, so I was expecting __toString to reflect this and allow me to use it as a string. -- Côme Chilliet FusionDirectory - https://www.fusiondirectory.org