Whilst weak typing has its benefits, I think typing is a little too weak in places. IMO "" should not be equal to 0 or coercable to 0. But of course "0" should equal 0. On Jul 17, 2012 3:04 PM, "Rasmus Lerdorf" <ras...@lerdorf.com> wrote:
> On 07/17/2012 03:07 AM, Pierre Joye wrote: > > hi, > > > > On Tue, Jul 17, 2012 at 2:12 AM, Gustavo Lopes <glo...@nebm.ist.utl.pt> > wrote: > > > >> Let's ignore empty arguments like "make[s] PHP feel modern". That > aside, the > >> main argument advanced in this message makes no sense. > > > > This idea has been proposed many times in the past and it is actually > > a very good proposal, for array, string or other types. > > > > The only reason why it is not yet implemented is the technical > > complexity to do it. We need pseudo objects and the likes, and it is > > really not something easy to do, in an efficient enough way. > > And also because most of the proposals are simply strong-typing in > disguise. If you turn scalars into objects and attach methods to those > objects are you still going to be able to call floor() on a numeric > string? This isn't as simple as people think on first glance and it > doesn't really clean up the global namespace since we still need to be > able to do type coercion which effectly implies that all scalar objects > need to include the bulk of the current set of scalar functions. > > -Rasmus >