PHP: final assessment

This covers the whole course. Take it after the last module.

Final quiz

1. Which statement prints text in PHP?
2. What type and value does "5" + 3 give?
3. What does strlen("PHP") return?
4. How do you read a whole number from a line of input?
5. What does 5 <=> 9 return?
6. Which loop goes through every item of an array?
7. How do you add 4 to the end of the array $a?
8. What does array_search return when the value is not found?
9. Which call removes the key Linus from the array $ages?
10. What does static $n = 0; do inside a function?
11. How does an arrow function fn($x) => $x * $r get $r?
12. Which keyword makes an independent copy of an object?
13. What does the keyword private mean for a property?
14. Which keyword adds a trait to a class?
15. What does throw do?
16. Which function splits a string into an array at a separator?

Practical assessment: A library loans system

Without using hints, write a PHP program that manages a small library from commands read on the standard input, in the style of the last lesson.

Final project

A class grade book: Build a command-line program that keeps the marks of students: add a mark, show a student's average, list the class ranked by average and report every wrong command clearly.

How it is evaluated

To complete this course