Test PHP8
Test PHP with answers to assess your knowledge and prepare for job interviews. Assess your technical level in 20 minutes.
My Results
Test details
PHP is an interpreted, imperative, and object-oriented language.
Mainly used for the creation of website and API, its use is evolving towards the creation of workers, machine learning, web scraping by controlling a browser thanks to Symfony Panther.
Version 8.0, released on November 26, 2020, follows previous version updates by improving the type system. This version also added a set of breaking changes and improvements in terms of performance.
About this quiz
The subjects covered will mainly be the changes brought by this new major version of PHP. Can you find valid syntaxes?
Have you taken enough time to explore what's new? Even JIT compiler, union types, attributes or named arguments ?
This quiz does not deal with any particular framework.
Only PHP under version 8.0 is discussed.
No knowledge of tools or ecosystem is necessary.
Test author : Dylan Ballandras - Stéphanie Trumtel
Presentation of the authors :
- Dylan Ballandras, backend developer and member of AFUP.
- Stéphanie Trumtel, backend developer and member of the AFUP Toulouse office
Sample question
What will this code display?
<?php
class Foo
{
private ?string $bar;
public function setBar(?string $secondLine): void
{
$this->bar = $secondLine;
}
public function getBar(): ?string
{
return $this->bar;
}
}
$foo = new Foo();
echo $foo->getBar() ?? 'john doe';
Developers ratings
Recommended tests
- Our interview questions for developer
- Our interview questions for Développeur Back-end