Symfony 7 – PHP – PHP Extensions

20 multiple-choice questions about common PHP extensions (PDO, mbstring, intl, cURL, JSON, XML/DOM, GD/Imagick, OpenSSL, Sodium, Zip, Phar, Filter, Hash, Fileinfo, PCNTL/POSIX, OPcache, etc.) with small code examples.


Question 1: How do you check at runtime whether an extension is loaded?

Question 2: Which statement about PDO is TRUE?

Question 3: Pick the correct PDO prepared statement usage for selecting a user by id.

Question 4: Why use mbstring functions with UTF-8 text?

Question 5: Which snippet correctly formats a number for fr_FR using intl?

Question 6: Select the minimal cURL snippet to GET a URL and capture the body.

Question 7: How do you make json_decode throw on invalid JSON?

Question 8: DOM vs SimpleXML — which is TRUE?

Question 9: Which statement about GD and Imagick is accurate?

Question 10: OpenSSL extension use-case in PHP is mainly…

Question 11: Which is a correct statement about the Sodium extension?

Question 12: Select the correct way to create a ZIP file with the ZipArchive class.

Question 13: What is a Phar archive in PHP?

Question 14: Which call validates an email address using the filter extension?

Question 15: How do you compare HMACs safely to avoid timing attacks?

Question 16: Which snippet gets a file’s MIME type using fileinfo?

Question 17: PCNTL/POSIX extensions are typically used for…

Question 18: What does the OPcache extension do?

Question 19: mysqli vs pdo_mysql — which is TRUE?

Question 20: Which statement about the JSON extension in modern PHP is correct?