Re: [RFC] is_literal()

From: Date: Sat, 21 Mar 2020 21:58:31 +0000
Subject: Re: [RFC] is_literal()
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-109191@lists.php.net to get a copy of this message
On Sat, 21 Mar 2020 at 21:23, Jakob Givoni <jakob@givoni.dk> wrote: > On Sat, Mar 21, 2020 at 3:26 PM Craig Francis <craig@craigfrancis.co.uk> > wrote: > > > > As to the name, it's to work alongside functions such as > > is_int(), is_string(), etc - is that a good enough reason? > > I think it could cause confusion since int and string are value types, > - literal is not a type as such, it merely describes the way the value > was created. > I'm happy to use a different name; but I should add that is_numeric() isn't really a type, there are other functions such as is_writable(), and the taint extension uses is_tainted(). > I'm under the impression that PHP already defines these as literals > > Does anyone know if that is correct? Does PHP remember how the string > variable / constant was created? > I've talked to Paul Dragoonis and Derick Rethans recently (they both kindly did talks at PHP-SW); when I mentioned it to Paul, I was told that's where I should start looking, and that was the correct terminology; and Derick helped confirm some of these ideas (but we were walking to the pub at the time). And while I keep trying, I don't know enough about C, or the internals of PHP.

« previous php.internals (#109191) next »