[RFC] Introduce Type Affinity

php.internals

Yasuo Ohgaki

11 years ago
Hi all, I had this idea for a long time, but I didn't have time to mention. Since I did mention this idea in basic type hints thread, I've created RFC for it. https://wiki.php.net/rfc/introduce-type-affinity SQLite2 was typeless. All data is stored as "text". Type affinity is SQLite3's idea to have native type for better performance. https://www.sqlite.org/datatype3.html PHP may have the same idea for better performance and code. It works well with coercive type or strict type (Not currently proposed one, though) Comments are appreciated! Regards,
-- Yasuo Ohgaki yohgaki@ohgaki.net

Pierre Joye

11 years ago
Hi Yasuo, On Mar 17, 2015 9:01 AM, "Yasuo Ohgaki" <yohgaki@ohgaki.net> wrote:
> > Hi all, > > I had this idea for a long time, but I didn't have time to mention. > Since I did mention this idea in basic type hints thread, I've > created RFC for it. > > https://wiki.php.net/rfc/introduce-type-affinity > > SQLite2 was typeless. All data is stored as "text". > Type affinity is SQLite3's idea to have native type for better
performance.
> https://www.sqlite.org/datatype3.html > > PHP may have the same idea for better performance and code. > It works well with coercive type or strict type (Not currently proposed > one, though) > > Comments are appreciated!
I very much appreciate your consistent effort to improve php, at all levels. However I won't comment on this RFC or any further RFCs trying to target 7. My reasoning is that we should now focus on getting it out, in time. I did not agree with the time plan about 7 development but it is what we decided. Let get back to work now.

Yasuo Ohgaki

11 years ago
Hi Pierre, On Tue, Mar 17, 2015 at 7:23 AM, Pierre Joye <pierre.php@gmail.com> wrote:
> I very much appreciate your consistent effort to improve php, at all > levels. > > However I won't comment on this RFC or any further RFCs trying to target > 7. > > My reasoning is that we should now focus on getting it out, in time. I did > not agree with the time plan about 7 development but it is what we decided. > Let get back to work now. >
I agree that we should concentrate for PHP7.0. The reason why I raised this topic is currently proposed "strict_types" does not work well with this. If inputs are converted/validated as certain types with or without this RFC, "strict_types" should raise error for mismatched types. However, current proposal does not do this depending on how "strict_types" is used... Regards,
-- Yasuo Ohgaki yohgaki@ohgaki.net

Pierre Joye

11 years ago
On Mar 17, 2015 9:42 AM, "Yasuo Ohgaki" <yohgaki@ohgaki.net> wrote:
> > Hi Pierre, > > On Tue, Mar 17, 2015 at 7:23 AM, Pierre Joye <pierre.php@gmail.com> wrote: >> >> I very much appreciate your consistent effort to improve php, at all
levels.
>> >> However I won't comment on this RFC or any further RFCs trying to target
7.
>> >> My reasoning is that we should now focus on getting it out, in time. I
did not agree with the time plan about 7 development but it is what we decided. Let get back to work now.
> > I agree that we should concentrate for PHP7.0. > The reason why I raised this topic is currently proposed "strict_types"
does not work
> well with this. > > If inputs are converted/validated as certain types with or without this
RFC, "strict_types"
> should raise error for mismatched types. However, current proposal does
not do this
> depending on how "strict_types" is used...
I do not see your point with strict type and what your RFC proposes is what ext/filter does. I would really not to start again this kind of discussion while trying to get 7 out in time as it is already quite a challenge.