Re: type hinting

From: Date: Sun, 06 Jan 2008 21:41:22 +0000
Subject: Re: type hinting
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.internals 
Request: Send a blank email to internals+get-34551@lists.php.net to get a copy of this message
On Jan 6, 2008 9:55 PM, Stefan Priebsch <stefan.priebsch@e-novative.de> wrote: > Pierre schrieb: > > When a method or function uses the strict typing, it is on purpose. It > > is documented (self documented and hopefully using normal docs). There > > is no need of error handling, it is an usage error and should raise a > > E_{whatever}, be happy, it will not be fatal as it is now in all these > > OO strictness (with or without good reasons :). > > Sorry, but I don't understand you. Why is there no need of error > handling? I meant in user land, like adding tests and raising exception or an error. > Clearly, it's a runtime error, which I either have to handle > or I have my program "crash" at some nonsense value. Wouldn't exactly > make me happy ;-) me neither :) But it is not something you can take care of (error is raised before your method/function gets the hand). Other reponses in this thread also confirmed why I rather prefer a strict-strict hinting instead of applying our current string to numeric magic conversion. One can see it as inconsistent but I tend to see it as more logical and reduce the wtf factor. -- Pierre http://blog.thepimp.net | http://www.libgd.org

« previous php.internals (#34551) next »