Err sorry yes John is correct.  I wasn't paying close enough attention.

Here's *my* vision of how that progression would look:

$a = "1";  // Current kosher unchanged.
weak int $a = "1"; // Converts to 1.  No error thrown.
strong int $a = "1"; // Converts to 1.  May or may not throw an error (I'm
still on the fence).

$a = "blah"; // Current kosher unchanged.
weak int $a = "blah"; // Throws E_x error level.
strong int $a = "blah"; // Throws E_y error level.


Where E_y > E_x.

--Kris


On Tue, Feb 28, 2012 at 1:52 PM, John Crenshaw <johncrens...@priacta.com>wrote:

> No, In the example given there's an error on int $a = "1". There should be
> no error because this juggles fine.
>
> John Crenshaw
> Priacta, inc.
>
> -----Original Message-----
> From: Kris Craig [mailto:kris.cr...@gmail.com]
> Sent: Tuesday, February 28, 2012 4:47 PM
> To: Richard Lynch
> Cc: internals@lists.php.net
> Subject: Re: [PHP-DEV] Scalar type hinting
>
> @Richard That's fairly close to what I'm thinking, yes.  But there seems
> to be a diverse range of ideas bouncing around right now, so at present
> it's all in flux.
>
> --Kris
>
>
> On Tue, Feb 28, 2012 at 1:44 PM, Richard Lynch <c...@l-i-e.com> wrote:
>
> > On Mon, February 27, 2012 4:34 pm, Kris Craig wrote:
> > > I think this is the main reason for differentiating between "strong"
> > > (or
> > > whatever word is appropriate) and "weak."  The developer may very
> > > well want their script to blow-up in such a case.
> >
> > I believe I actually "get it" now...
> >
> > You want 3 layers:
> >
> > $a = "1"; //current kosher unchanged
> > weak int $a = "1"; // some E_x error level strong int $a = "1"; //
> > some E_y error level where E_y > E_x
> >
> > Is that a correct summation?
> >
> > --
> > brain cancer update:
> > http://richardlynch.blogspot.com/search/label/brain%20tumor
> > Donate:
> >
> > https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=F
> > S9NLTNEEKWBE
> >
> >
> >
> > --
> > PHP Internals - PHP Runtime Development Mailing List To unsubscribe,
> > visit: http://www.php.net/unsub.php
> >
> >
>

Reply via email to