What are superglobals in PHP? Can you name three and explain their specific use cases?

Last updated 15 June 2026

Superglobals are built-in PHP variables that are automatically available in every scope (no global keyword needed), holding request, server, and session data.

  • $_GET: Holds URL query-string parameters: read filters, pagination, search terms.

  • $_POST: Holds form-body data from POST submissions: logins, record creation, file metadata.

  • $_SESSION: Persists per-user data across requests (logged-in user id, cart) once session_start() is called.

  • Others worth knowing: $_SERVER (headers, paths, request method), $_COOKIE, $_FILES, $_ENV, and $_REQUEST.

  • https://dev.to/tpointtech/from-variables-to-oop-php-interview-questions-for-all-levels-ih2
  • https://www.sprintzeal.com/blog/php-interview-questions
  • https://www.geeksforgeeks.org/php/php-interview-questions-and-answers/
All PHP interview questions