Re: AW: PHP is Zero

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 13, 2013 at 1:49 PM, BUSCHKE Daniel <
Daniel.BUSCHKE@xxxxxxxxxxxxx> wrote:

> To be more technical:
>
> If intval('8315e839da08e2a7afe6dd12ec58245d') would return NULL instead of
> 8315 then PHP would be still weak-typed and the developer could know that
> the conversion failed. Good idea? Of course NULL should be transparent in
> operations like +. So 0 + NULL should be still 0.
>
> Regards
> Daniel
>
>
It would just break too much. I see lots of scripts that have things like
this:

$var = '12 beers';

echo $var + 4;

and they expect it to be 16 of course.

Or what about badly trimmed strings, when reading from a file it can
include extra line endings and it's so much easier to just ignore that
because PHP will convert it just fine.

- Matijn

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux