K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which keyword refers to the current class? (A) this (B) self (C) static (D) parent 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (B) self Explanation: self refers to the current class.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP feature allows dependency injection? (A) Traits (B) Type hinting (C) Namespaces (D) Autoloading 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (B) Type hinting Explanation: Type hinting helps inject dependencies.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which Composer file defines project dependencies? (A) composer.lock (B) composer.json (C) package.json (D) autoload.php 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (B) composer.json Explanation: composer.json defines dependencies.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function converts an array or object into JSON? (A) json_encode() (B) json_decode() (C) array_to_json() (D) encode_json() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (A) json_encode() Explanation: json_encode() converts PHP data to JSON.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function converts JSON into an associative array? (A) json_encode() (B) json_decode($json, true) (C) json_parse() (D) decode_json() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (B) json_decode($json, true) Explanation: Second parameter true returns an associative array.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which HTTP status code represents successful resource creation? (A) 200 (B) 201 (C) 204 (D) 202 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (B) 201 Explanation: 201 Created indicates a new resource was created.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which HTTP status code indicates a bad request? (A) 400 (B) 401 (C) 403 (D) 404 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (A) 400 Explanation: 400 means the request syntax or data is invalid.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which HTTP status code indicates unauthorized access? (A) 400 (B) 401 (C) 403 (D) 404 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (B) 401 Explanation: 401 indicates authentication is required.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which HTTP status code indicates forbidden access? (A) 401 (B) 402 (C) 403 (D) 405 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (C) 403 Explanation: 403 means access is forbidden.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which HTTP method is used to update an entire resource? (A) POST (B) PUT (C) PATCH (D) GET 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (B) PUT Explanation: PUT replaces the entire resource.