Re: Coercive Scalar Type Hints RFC

From: Date: Sun, 22 Feb 2015 06:17:11 +0000
Subject: Re: Coercive Scalar Type Hints RFC
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-83459@lists.php.net to get a copy of this message
On 22 בפבר׳ 2015, at 02:07, François Laupretre <francois@php.net> wrote: >> De : Lester Caine [mailto:lester@lsces.co.uk] >> >> Fixed length fields may well be a data source so having to strip them >> before using them just seems a backward step. The basic C library simply >> strips the white space so are we looking at using an alternative? > > I guess you got it wrong : we'll ignore leading and trailing blanks, as well as leading > 0s. We say we restrict because, where we accepted *every* trailing chars, we now only accept blanks. > So fixed length fields will work as before. Actually the Coercive STH RFC currently takes the position that leading or trailing spaces will not be accepted. In general, the idea is to support the conversions which are likely to be right and safe in the vast majority of cases, and if there's any doubt - reject it. It's of course up for discussion, but it's that concept that I believe can bridge the gap between proponents of strict and proponents of dynamic typing. Thanks, Zeev

« previous php.internals (#83459) next »