PHP Quiz: 12 Questions on PHP 8
This free PHP quiz checks the knowledge you need to build secure, modern PHP applications: PHP 8 features such as match, the nullsafe operator and named arguments, strict types, arrays, superglobals, sessions, PDO prepared statements, password hashing, include versus require, comparison rules and escaping output against XSS. It suits students and junior developers. Answer all 12 questions, check your score, then read the explanations and revisit the PHP guide for anything you missed.
Frequently asked questions
Which PHP version does this quiz assume?
PHP 8.x. Some answers differ in PHP 7, for example how a number is compared with a non-numeric string.
Why are there security questions in a PHP quiz?
SQL injection, XSS and weak password storage are among the most common flaws in PHP applications, so prepared statements, escaping and password_hash() are core skills.
Do I need a framework to use these ideas?
No. Everything here is plain PHP. Frameworks such as CodeIgniter and Laravel build on the same features.