PHP: Mixed Practice Test (Grades 9–12)
These are US practice tests (grades, CSTA standards). In the UK? Try the UK version →
A free PHP practice test for Grades 9–12 (ages 14–18): 20 questions, graded instantly – write, fix and predict real PHP code in your browser. No sign-up. This test is for Grades 9–12 (ages 14–18).
Before you start
20 questions on everything in the PHP course, mixed, picked from a bank of 72 each time. Some questions ask what a program prints or which message PHP shows; some ask you to put lines in order, fill in a trace table, or write or fix a short program. When you write or fix code, press Run to try it. It is graded when you move on: your program is run in your browser against the example and some hidden tests (other values and other form data). Choose Practice to see the answer after each question, or Test to see your answers at the end.
- 20 questions – a new mix each time you try
- PHP runs in your browser – nothing to install (the first code question downloads PHP once, about 3 MB)
- A keyboard helps for the coding questions
No sign-up and no adverts. Your answers and your code stay on this device. Nothing you type in the test is sent to us – unless you choose to report a problem with a question.
How it is graded: Classfern's own checks, in your browser. Code is run in a locked box against tests, some of them hidden; nothing is graded by a person or by guesswork. Spot a mistake? Use the Report button.
Classfern practice material. Not an official test. Written by Classfern for practice. Not affiliated with or endorsed by any exam board, testing agency, school district or government department. Classfern is not affiliated with or endorsed by The PHP Group. PHP runs here as php-wasm, under its open-source licences.
Lines up with the CSTA K–12 Computer Science Standards (2017): 2-AP-11 – Create clearly named variables of different data types and operate on them; 2-AP-12 – Design and iteratively develop programs with control structures incl. nested loops and compound conditionals; 2-AP-19 – Document programs so they are easier to follow, test and debug; 3A-AP-13 – Prototype algorithms for problems drawing on prior knowledge and interests; 3A-AP-14 – Use lists to simplify solutions and generalise beyond single variables; 3A-AP-15 – Justify choice of control structures (implementation, readability, performance); 3A-AP-17 – Decompose problems using procedures, modules and/or objects; 3A-AP-18 – Create artifacts using procedures, data+procedure combinations or interrelated programs; 3B-AP-10 – Use and adapt classic algorithms to solve problems; 3B-AP-11 – Evaluate algorithms for efficiency, correctness and clarity; 3B-AP-12 – Compare and contrast fundamental data structures and their uses; 3B-AP-13 – Trace the execution of recursive algorithms; 3B-AP-14 – Build solutions from student-created procedures, modules or objects; 3B-AP-16 – Reuse code from libraries and APIs; 3B-AP-17 – Plan and develop programs for broad audiences using a software life cycle; 3B-AP-18 – Explain security issues that could compromise programs; 3B-AP-21 – Develop and use test cases to check a program meets its specification; 3B-AP-23 – Evaluate key program qualities through a process such as code review; 3B-AP-24 – Compare programming languages and their suitability for different problems. The standard codes are CSTA's; the short descriptions are our own words.
More high school computer science tests · PHP course · All practice tests