|
Posted by Mani on 09/03/06 05:38
Hi
Thnks for your reply.
I understood the point explained by you and have to learn good
programming style.
I am in a situation to do further process only if it is less than 4 so
i need to compare in better way not like the existing code. Can you
suggest how to write alternative code for the following snippet?
if ( (int) $forecast['day_sequence'] < 4 ) {
--
Mani
Alvaro G. Vicario wrote:
> *** Mani escribió/wrote (2 Sep 2006 01:52:33 -0700):
> > Bad code in the sense... i ddint get ur point. Can you explain more
> > about segmentation fault?
> >
> > You mentioned that automatic typecast wont raise segmentation error,
> > then how come after doing only explicit typecast in the code it worked
> > well
>
> Alright, let's use a non-programming example. Suppose you're typing a
> dossier in Microsoft Word. You need to highlight an specific paragraph so
> select the text and press the "bold" toolbar button. And then you get a
> message that says "Application performed an illegal operation and will be
> shut down" and Word crashes. Does it mean there's something wrong in using
> bold fonts in documents? Obviously not!
>
>
> >> The condition is true and it also raises a notice: "Notice: Object of class
> >> Foo could not be converted to int"
> >
> > Will there any difference between class object and xml object?
>
> I thought you used word "object" in PHP context. Never mind, whatever an
> object is for you, it doesn't make any sense to cast it to integer. It's
> like checking whether a JPEG picture is greater or equal than zero, it's
> total nonsense.
>
>
> --
> -+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
> ++ Mi sitio sobre programación web: http://bits.demogracia.com
> +- Mi web de humor con rayos UVA: http://www.demogracia.com
> --
Navigation:
[Reply to this message]
|