Re: [RFC] Scalar Type Hinting With Casts (re-opening)

From: Date: Mon, 14 Jul 2014 15:41:54 +0000
Subject: Re: [RFC] Scalar Type Hinting With Casts (re-opening)
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-75477@lists.php.net to get a copy of this message
On 14 Jul 2014, at 16:39, Lester Caine <lester@lsces.co.uk> wrote:

> The irritating thing here is HAVING to add the error_handler which may
> well have been installed already for other reasons ... possibly in some
> third party library to compensate for other changes?

The intention is obviously that you wouldn’t skip the E_RECOVERABLE_ERROR, but my point was that
if you really wanted to, you could. The other type hints are strict, hence this one is too, it’s
just tolerant of equivalent values that can be losslessly converted.

If you want to pass user data safely to such a function, (int) or (float) first is probably a good
idea.

--
Andrea Faulds
http://ajf.me/






Thread (250 messages)

« previous php.internals (#75477) next »