On 12/05/15 22:38, Rowan Collins wrote:
> On 12 May 2015 22:32:55 BST, Rowan Collins <rowan.coll...@gmail.com> wrote:
>> >It is already possible to pass around, and type hint for, any class of
>> >object, so you could for instance have a DatabaseID class. PHP's lack
>> >of operator overloading makes that less appealing, perhaps, but it
>> >would work.
> Incidentally, it's still not the type hint that's performing validation here 
> - that would go in the constructor of the object, I guess. Rather, the type 
> hint holds the promise that the validation has already happened somewhere 
> else.

That most good libraries already have the validation code is my point
here. Either the variable has already been validated, so the type hint
is not relevant. OR the data still needs validating in which case only
'string' is now usable? With any pre-processing now requiring a switch
back to string ... this is where I'm having problems seeing how if
someone switches a library to using strict type hinting internally that
will not have an impact on using the same library as it is currently
being used without type hinting.

-- 
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to