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. Quote 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. Quote 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. Quote 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 Quote 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 Quote 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? Quote Link to comment https://forums.phpfreaks.com/topic/224407-php-question/#findComment-1159286 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.