Jump to content

php question


alin19

Recommended Posts

i have took a test that i think it has some errors:

 

can you please confirm or infirm that A is the right answer?

 

 

 

Question:

 

The default value for __FILE__ is _______________________________.

 

 

 

A.

 

the complete path of the currently executing script

 

B.

 

the relative path of the currently executing script

 

C.

 

a magical constant; it does not have a default value

 

D.

 

the complete path of the previous executed script

 

E.

 

the relative path of the previous executed script

 

Correct Answer: C

User Answer: A

Explanation: The PHP engine stores the full path and filename of the currently executing script within the __FILE__ constant.

Link to comment
Share on other sites

C is indeed the correct answer.

 

thanks

 

this one?

 

if i make a get, delete, head request, $_POST var is still initialized with an empty array in my opinion

 

Question:

 

The $_POST[] superglobal is initialized ONLY when the user agent is

making a request using the _________ method.

 

 

A.

 

POST

 

B.

 

TRACE

 

C.

 

DELETE

 

D.

 

HEAD

 

E.

 

OPTIONS

 

Correct Answer: A

User Answer: A ; C ; D

Explanation: $_POST[] superglobal is initialized by the web server only when it receives an HTTP request via the POST method.

Link to comment
Share on other sites

C is indeed the correct answer.

 

__FILE__ The full path and filename of the file. If used inside an include, the name of the included file is returned. Since PHP 4.0.2, __FILE__ always contains an absolute path with symlinks resolved whereas in older versions it contained relative path under some circumstances.

 

of couse it is also a magic constant , but why is my answer not right?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.