The PHP online test assesses candidates' knowledge of programming in PHP language and their ability to leverage commonly used built-in functions.

It's an ideal test for pre-employment screening. A good PHP developer needs to be able not only to solve problems using PHP as the programming language but also recognize when to take advantage of its rich set of built-in functions.

This test requires candidates to be able to solve coding problems in PHP and find and fix bugs in PHP programs.

Recommended Job Roles
PHP Developer
Web Developer
Sample Candidate Report

Sample Free Questions

File Owners

10min
  -  
Easy  
  -  
CODE

PHP Language Public

Implement a groupByOwners function that:

  • Accepts an associative array containing the file owner name for each file name.
  • Returns an associative array containing an array of file names for each owner name, in any order.

For example, for associative array ["Input.txt" => "Randy", "Code.py" => "Stan", "Output.txt" => "Randy"] the groupByOwners function should return ["Randy" => ["Input.txt", "Output.txt"], "Stan" => ["Code.py"]].

Palindrome

10min
  -  
Easy  
  -  
CODE

PHP Strings Public

A palindrome is a word that reads the same backward or forward.

Write a function that checks if a given word is a palindrome. Character case should be ignored.

For example, isPalindrome("Deleveled") should return true as character case should be ignored, resulting in "deleveled", which is a palindrome since it reads the same backward and forward.

User Input

15min
  -  
Easy  
  -  
CODE

PHP OOP Public

The user interface contains two types of user input controls: TextInput, which accepts all texts and NumericInput, which accepts only digits.

Implement the class TextInput that contains:

  • Public function add($text) - adds the given text to the current value.
  • Public function getValue() - returns the current value (string).

Implement the class NumericInput that:

  • Inherits from TextInput.
  • Overrides the add method so that each non-numeric text is ignored.

For example, the following code should output '10':

$input = new NumericInput();
$input->add('1');
$input->add('a');
$input->add('0');
echo $input->getValue();
Use Free Questions On a Trial Plan

Premium Questions

The premium question library contains our unique, hand-crafted questions. We offer a refund if you find any of them answered online.

Questions
Cookie, Chain Link, Crop Ratio, Hobbies, Category Tree, Programmer Teacher, Greeter, Read First Line, Chicken, Numbers to Text, Products, Array Sum, Filter, Paragraph, Last Key, Vectors, Word Count, Log Parser, Date Transform, Needle, Height, Username, View Count, Unique Numbers, Shipping, Segment, Array Search, Read Write Execute
Skills
PHP Language Data structures Bug fixing Arrays Iteration OOP Exceptions Strings Serialization Sorting Arithmetic Searching Stream Algorithmic thinking Recursion
Score Distribution
Loading...
Pricing For Premium Questions