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
https://forums.phpfreaks.com/topic/224407-php-question/
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
https://forums.phpfreaks.com/topic/224407-php-question/#findComment-1159277
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
https://forums.phpfreaks.com/topic/224407-php-question/#findComment-1159286
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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