Re: Design by Contract and scalar types ...
| From: | Yasuo Ohgaki | Date: | Mon, 09 Feb 2015 20:41:40 +0000 |
| Subject: | Re: Design by Contract and scalar types ... | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-82318@lists.php.net to get a copy of this message | ||
Hi Lester,
On Tue, Feb 10, 2015 at 4:52 AM, Lester Caine <lester@lsces.co.uk> wrote:
> Much has been made of adding a class string to handle all the extra
> unicode processing, but I am now thinking that a properly exposed string
> and integer class which has the ability to assign constraint checks does
> make sense. Then use of an integer value on a 32bit platform can error
> when the actual value is too big for the target use. THAT is what strict
> type checking is about!
>
Scalar may have object capability.
https://wiki.php.net/rfc/autoboxing
IIRC, this wasn't popular, but people's mind may change as time goes by.
It does not cover your requirement, but it may be extended the way it does.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net