Re: A Few Noob Questions [message #175128 is a reply to message #175127] |
Tue, 16 August 2011 15:11 |
A.Reader
Messages: 15 Registered: December 2010
Karma:
|
Junior Member |
|
|
On Tue, 16 Aug 2011 11:02:40 -0400,
"eBob.com" <eBob(dot)com(at)totallybogus(dot)com> wrote:
> Is "script" official terminology in PHP? The book I am reading says
> "Built-in superglobal variables are visible everywhere within a script." but
> has never explicitly defined "script". (Although there is a hint that maybe
> everything between tags is a script.)
"Script" in this context is a synonym for "program". Some people
seem to need to make things confusing by giving new names to old
concepts.
>
> How can the "units" of PHP between tags communicate? Can my PHP code create
> $GLOBALS variables? How about $_SESSION variables?
You'll have to ask the question in a different way.
>
> The book gives the following example of a ternary operator:
>
> ($grade >= 50 ? 'Passed" : "Failed")
>
> I don't understand the function of the enclosing parentheses. The official
> doc at php.net doesn't seem to suggest that the parentheses are necessary.
The parens encapsulate the expression/statement, and prevent the
compiler from getting confused. You'll see similar uses in other
contexts.
>
> Just to make sure, "@" only suppresses MESSAGES. It does not interfere with
> try/catch logic/code. Right?
Right.
|
|
|