← PHPChallenge.com

Coding · Facts & stats

PHP facts & stats

7 fact-checked facts about the PHP programming language, each with the reason behind it. 5 more are in today's round and join this page after it closes.

Play today's round

The basics

In PHP, variable names begin with which symbol?

Answer$

PHP variables always start with a dollar sign, as in $name.

Which tag opens a block of PHP code in a file?

Answer<?php

PHP code begins with <?php and can end with ?>.

Going deeper

Which PHP operator checks that two values are equal AND of the same type?

Answer===

=== is the identical operator: both value and type must match, unlike the looser ==.

In PHP, which operator accesses a property or method of an object?

Answer->

The arrow -> reaches an object's members, as in $user->name; => pairs keys and values in arrays.

Which built-in PHP function returns the length of a string?

Answerstrlen()

strlen() returns the number of bytes in a string; count() is for arrays.

Expert level

PHP's scope resolution operator '::' is also called what, from the Hebrew for 'double colon'?

AnswerPaamayim Nekudotayim

The Hebrew name Paamayim Nekudotayim means 'double colon' and has even appeared in PHP error messages.

Which PHP operator returns its left operand if it exists and is not null, otherwise the right one?

Answer??

The null coalescing operator ?? is a short way to supply a default when a value is unset or null.

Know these cold?Today's round is five questions like these, 20 seconds each. Your streak and level follow you to every arena.Play today's round