PHP 8.3 · 15 QUESTIONS · ABOUT 10 MINUTES

Is zero equal to "a"? Depends on the year.

PHP still runs much of the web, and PHP 8 quietly changed some of its oldest rules. Fifteen snippets on comparison, arrays, closures, OOP and modern features, each explained. No sign-up, nothing saved.

Start the PHP test
var_dump(0 == "a");
PHP 7bool(true)
PHP 8bool(false)
QUESTION 1 / 15 · TYPES & COMPARISONMedium

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
QUESTIONS 1 TO 3, ALL AT ONCE

Which of these are equal?

0"0"""nullfalse"a"[]
0
"0"
""
null
false
"a"
[]
0 == "a"false"a" isn't numeric, so since PHP 8 the int is converted to a string and they're compared as strings. Before PHP 8 this was the other way round.Click any square. With == there are 16 equal pairs out of 49; with === only the 7 on the diagonal.
PHP 5 HABITS → PHP 8

Not the PHP you remember

OLD HABIT
$id = $_GET["id"];$r = mysqli_query($db, "SELECT * FROM users WHERE id = $id");
MODERN
$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.

~3 in 4websites with a known server language use PHPW3Techs has reported a share around three-quarters for years, helped by WordPress, which runs on PHP.3
1994 → 1995Personal Home Page Tools. Rasmus Lerdorf wrote a set of CGI scripts to track visits to his online CV, then released them publicly.1
2015 · 7.0Twice as fast. The rewritten engine roughly doubled real-world performance over PHP 5.6 and added scalar type declarations.2
2020 · 8.0Saner comparisons. 0 == "a" became false, alongside match, named arguments, the nullsafe operator and a JIT compiler.2
2021 · 8.1Enums and readonly. Native enums, readonly properties and fibers brought PHP's type system closer to other modern languages.2
  1. The PHP Group. History of PHP. php.net manual.
  2. The PHP Group. PHP 7.0, 8.0 and 8.1 release announcements. php.net.
  3. W3Techs. Usage statistics of server-side programming languages for websites.

Where to go next

You know PHP. How do you reason?

Our full IQ test measures the logic and working memory behind good code: 60 questions across four domains, about 30 minutes.

Take the full IQ test