30 random questions, 30 minutes, at the level you choose: php 8, pdo, security, sql queries, indexes and laravel. After you submit you get your score, your strong and weak topics, and the right answer with an explanation for every question.
Want to revise first? Read the PHP and MySQL interview questions and answers.
The test draws on 300 PHP and MySQL questions in 12 topics, across three levels. Each attempt picks 30 of them at random for the level you choose.
One question from each level, the way they appear in the test. Try it, then open the answer.
var_dump("abc" == 0); Answer: bool(false). Since PHP 8, comparing a non-numeric string with a number converts the number to a string and compares strings, so "abc" == 0 is false. In PHP 7 the string was cast to 0 and the result was true, which caused many bugs.
$e = [['n' => 'A', 's' => 300], ['n' => 'B', 's' => 100], ['n' => 'C', 's' => 200]];
usort($e, fn ($x, $y) => $y['s'] <=> $x['s']);
echo implode(',', array_column($e, 'n')); Answer: A,C,B. The spaceship operator returns -1, 0 or 1. Putting $y before $x reverses the order, so the rows are sorted by s from highest to lowest: 300, 200, 100. array_column() then picks the n values.
Answer: Liskov substitution: code that expects a Storage can no longer use the subclass safely. A subclass must honour the parent's contract, so any code written for Storage keeps working when given a subclass. A write() that always fails breaks callers. Better: separate ReadableStorage and WritableStorage interfaces, and let the read-only class implement only the first.
Take the full PHP and MySQL mock test: 30 questions, 30 minutes.
A question counts as right only when you pick exactly the right option, or all the right options where it says so; a question left blank counts as wrong. Your score is the share of the 30 questions you got right. The result also scores every topic, so you know what to revise before the interview.
Yes. The PHP and MySQL mock test is free. You need a free CoreHRx Jobs account to start it, so your score and the topics to work on are saved.
Each test has 30 multiple-choice questions to answer in 30 minutes, picked at random from 300 PHP and MySQL questions across three levels, so every attempt is different.
The questions cover SQL Queries, Indexes, PHP Core, Security, Laravel, OOP, Transactions, Arrays, PDO, Scaling, Schema Design, Sessions. Your result shows how you did in each topic.
Fresher if you are a student or have less than a year of experience, Intermediate for 1 to 5 years at work, and Experienced for 5 years or more.
Only your best PHP and MySQL score, and only when it is 60% or more. It shows on the job applications you send on CoreHRx. Lower scores stay private.
Yes, up to 10 tests a day. Each attempt picks questions you have not seen recently first.