Thank you for the confirmation.

What I am saying here is that, although this behavior was fine for objects,
it is not enough for scalars. One of the main arguments in favor of the
adoption of this syntax was that null was the only possible default value
for objects anyway. This obviously is not the case with for scalar types.
This is why I suggest a different syntax (which can also be used by object
types for consistency).

Lazare INEPOLOGLOU
Ingénieur Logiciel


2012/3/12 Anthony Ferrara <ircmax...@gmail.com>

> Lazare,
>
> > The patch of Anthony, clearly states that this is accepted:
> >
> > function foo ( int $bar = null ) { }
> >
> > And this is what I called an int|null.
>
> Yup, it does.  Because that's the current behavior with array and
> object casting.  If you default it to null in the declaration, null is
> a valid value.  If you don't, it's not...
>

Reply via email to