Reply to Re: newbie syntax question

Your name:

Reply:


Posted by leegold on 02/13/06 00:24

>
> print '12==12 : '.12==12
>
> ...you might instead use:
>
> print '12==12 : '.(12==12)
>
> ...and even more correctly you would convert (12==12) to a string
> before concat-ing it. I'll let you figure out the best way to do that.
>
> Now as to figure out why your program gives the odd '112 == 12 : 1':
> The first thing PHP does here is evaluate 12 == 12, converts it to a
> string

I don't understand - the ( ) enforces that (12==12) is evaluated first *yet*
at the same time you say above that PHP's default action is exactly that as
well - so while adding the parens fixes it (I tested it) I still don't
understand why - cause you state that that order of precedence is the
default...do you see what I'm getting at? If it's the default that "==" will
get eval 1st then the parans should have no effect - but they do...

And below you show that print function returns and prints true (the 1), but
I'm not saying print(print...) ie. I'm not telling it to evaluate itself...

Too much for a sub genius like me to handle - i thought the line (arg) evals
and "prints" just send it to output Whoa...

> so that it can be passed to the print function and then it
> passes that result to the print function.

Whoa, that's saying that the initial argument to the print function is not
completely evaluated, but only half-way evaluated and passed and then...gosh
I'd expect the function to let the args or params - whatever - I'd expect it
to print the result of the line and the print fuction itself not to be a
factor like your saying.
.....

Thanks

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация