What does this print in PHP 8?
var_dump(0 == "a");
What this PHP test measures, in short
This test checks whether you can predict what modern PHP does: how == juggles types, when arrays are copied, how references and closures capture variables, how objects and static calls behave, and what PHP 8 features like match, enums, readonly and ?-> do.
Snippets assume PHP 8.3 with the opening <?php tag left out. The questions are our own and not standardised against a population, so treat the result as a knowledge check, not a certification.
By What's Your IQ · Reviewed 4 Oct 2026- Format
- 15 predict-the-output questions, 4 options each
- Topics
- Types and comparison, strings and arrays, functions and closures, OOP, modern PHP
- Version
- PHP 8.3
- Language
- Created by Rasmus Lerdorf, 1994
Which of these are equal?
Not the PHP you remember
$id = $_GET["id"];$r = mysqli_query($db, "SELECT * FROM users WHERE id = $id");
$stmt = $pdo->prepare( "SELECT * FROM users WHERE id = ?");$stmt->execute([$_GET["id"]]);$user = $stmt->fetch();
Building SQL from request input invites SQL injection. Prepared statements send the value separately from the query, so it can never be run as SQL.
- The PHP Group. History of PHP. php.net manual.
- The PHP Group. PHP 7.0, 8.0 and 8.1 release announcements. php.net.
- W3Techs. Usage statistics of server-side programming languages for websites.