alin19 Posted January 14, 2011 Share Posted January 14, 2011 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 More sharing options...
trq Posted January 14, 2011 Share Posted January 14, 2011 C is indeed the correct answer. Link to comment https://forums.phpfreaks.com/topic/224407-php-question/#findComment-1159274 Share on other sites More sharing options...
alin19 Posted January 14, 2011 Author Share Posted January 14, 2011 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 More sharing options...
revraz Posted January 14, 2011 Share Posted January 14, 2011 A Link to comment https://forums.phpfreaks.com/topic/224407-php-question/#findComment-1159283 Share on other sites More sharing options...
alin19 Posted January 14, 2011 Author Share Posted January 14, 2011 A why is that? i have this code <?php var_dump($_POST); ?> i make a GET request to that page , it will show : array(0) { } if it was not initialized it would have been NULL , please explain Link to comment https://forums.phpfreaks.com/topic/224407-php-question/#findComment-1159284 Share on other sites More sharing options...
alin19 Posted January 14, 2011 Author Share Posted January 14, 2011 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.