K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which HTTP method is used to partially update a resource? (A) POST (B) PUT (C) PATCH (D) DELETE 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (C) PATCH Explanation: PATCH updates part of a resource.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function sets HTTP response status code? (A) http_status() (B) status_code() (C) http_response_code() (D) set_status() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (C) http_response_code() Explanation: http_response_code() sets or gets the HTTP status.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function sends a raw HTTP header? (A) send_header() (B) header() (C) http_header() (D) set_header() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (B) header() Explanation: header() sends HTTP headers.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function reads raw JSON input from request body? (A) $_POST (B) file_get_contents('php://input') (C) $_REQUEST (D) json_input() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (B) file_get_contents('php://input') Explanation: Used to read raw request body.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function outputs JSON with correct headers? (A) echo json_encode() (B) print json_encode() (C) header('Content-Type: application/json') (D) Both 1 and 3 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (D) Both 1 and 3 Explanation: Header + json_encode ensures proper JSON response.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP OPcache feature improves performance? (A) Caching PHP output (B) Caching compiled bytecode (C) Caching database queries (D) Caching sessions 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (B) Caching compiled bytecode Explanation: OPcache stores precompiled PHP bytecode.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which php.ini directive enables OPcache? (A) opcache.enable (B) opcache.start (C) opcache.on (D) opcache.cache 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (A) opcache.enable Explanation: opcache.enable turns OPcache on.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function measures script execution time in microseconds? (A) time() (B) microtime() (C) execution_time() (D) script_time() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (B) microtime() Explanation: microtime() returns current Unix timestamp with microseconds.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP feature enforces strict type checking? (A) declare(strict_types=1) (B) type_check() (C) strict_mode() (D) php_strict() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (A) declare(strict_types=1) Explanation: Enables strict type checking.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP interface must be implemented to use foreach with objects? (A) Iterator (B) Iterable (C) Traversable (D) ArrayAccess 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (C) Traversable Explanation: Traversable allows object iteration.