Re: is_digits() and digits type

From: Date: Tue, 12 May 2015 21:38:46 +0000
Subject: Re: is_digits() and digits type
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-86184@lists.php.net to get a copy of this message
On 12 May 2015 22:32:55 BST, Rowan Collins <rowan.collins@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.

« previous php.internals (#86184) next »