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

2020-03-12 Thread Côme 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

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

2020-03-11 Thread Larry Garfield
On Wed, Mar 11, 2020, at 4:57 AM, Nikita Popov wrote: > On Tue, Mar 10, 2020 at 5:19 PM Côme Chilliet < > come.chill...@fusiondirectory.org> wrote: > > > Le mardi 10 mars 2020, 15:53:41 CET Nikita Popov a écrit : > > > Would __toString() return $token->text? I'm not strictly opposed to this, > >

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

2020-03-11 Thread Nikita Popov
On Tue, Mar 10, 2020 at 5:19 PM Côme Chilliet < come.chill...@fusiondirectory.org> wrote: > Le mardi 10 mars 2020, 15:53:41 CET Nikita Popov a écrit : > > Would __toString() return $token->text? I'm not strictly opposed to this, > > but I'd be hard pressed to think of a situation where I would

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

2020-03-10 Thread Côme Chilliet
Le mardi 10 mars 2020, 15:53:41 CET Nikita Popov a écrit : > Would __toString() return $token->text? I'm not strictly opposed to this, > but I'd be hard pressed to think of a situation where I would prefer > writing (string) $token over $token->text. Generally, the less magic the > better :) My

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

2020-03-10 Thread Nikita Popov
On Tue, Mar 10, 2020 at 12:36 PM Côme Chilliet < come.chill...@fusiondirectory.org> wrote: > Hello, > > I know I’m late, but shouldn't these tokens have a __toString() method? > It’s not listed in rejected features. > Would __toString() return $token->text? I'm not strictly opposed to this, but

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

2020-03-10 Thread Côme Chilliet
Hello, I know I’m late, but shouldn't these tokens have a __toString() method? It’s not listed in rejected features. -- Côme Chilliet FusionDirectory - https://www.fusiondirectory.org -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

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

2020-03-06 Thread Nikita Popov
Hi internals, I've opened voting on https://wiki.php.net/rfc/token_as_object, which adds a new object-based interface to the tokenizer. Voting closes on 2020-03-20. Regards, Nikita