FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » A Few Noob Questions
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: A Few Noob Questions [message #175131 is a reply to message #175127] Tue, 16 August 2011 16:03 Go to previous messageGo to previous message
Tim Streater is currently offline  Tim Streater
Messages: 328
Registered: September 2010
Karma:
Senior Member
In article <3Ev2q.149930$AU4(dot)73655(at)en-nntp-07(dot)dc1(dot)easynews(dot)com>,
"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.)
>
> How can the "units" of PHP between tags communicate? Can my PHP code create
> $GLOBALS variables? How about $_SESSION variables?

Are you talking about a file that might contain a number of <?php ?> tag
pairs?

> 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.

I can't remember if this is actually the case but it probably has to do
with operator precedence. If you put parens around it then you know it
will be executed as a unit. Otherwise you may find that when you combine
it with other expressions execution does not proceed as you expect. It
may also make things clearer to you the reader, even if strictly they
are not necessary.

> Just to make sure, "@" only suppresses MESSAGES. It does not interfere with
> try/catch logic/code. Right?

Right.

--
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to integrate paypal payment Indian currency support ..?
Next Topic: Looking for good C and C++ PHP plugin examples
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 01:36:47 GMT 2024

Total time taken to generate the page: 0.04088 seconds