On Wed, Jul 1, 2009 at 23:07, Paul Biggar<paul.big...@gmail.com> wrote:
> So, what you're saying is, the patch already handles coercion? If
> that's the case, then problem solved.

The patch offers scalar type _hinting_. Not type _casting_.

Type hinting in PHP works very simply: If the value doesn't type-match
the argument information (arginfo internally) then it will be rejected
and E_RECOVERABLE_ERROR thrown.

In most circumstances that error is fatal. However. If the user
chooses then he can ignore that error (by creating his own error
handler) and continue the execution.

Type _hinting_ is in no way related to type _casting_.


Furthermore, the patch introduces couple of new types, "scalar" and
"numeric". These are "magic types" and do value-to-real-type
comparison. No type casting.
The scalar type hint accepts strings, booleans, ints and floats.
The numeric type hint accepts strings (that pass is_numeric()),
booleans, ints and floats.


-Hannes

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

Reply via email to