PHP interview questions


Total available count: 33
Subject - PHP Frameworks
Subsubject - PHP

What is scope resolution operator(::) in PHP?

The Scope Resolution Operator is also called Paamayim Nekudotayim or in other words the double colon, is a token that allows access to static, constant, and overridden properties or methods of a class.

Example:  

<?php
class Slightbook{
    const CONST_VALUE = 'A constant value';
}

$classname = 'Slightbook';
echo $classname::CONST_VALUE;

echo Slightbook::CONST_VALUE;
?>

 




Next 5 interview question(s)

1
What is the difference between == and === in PHP?
2
What is the difference between FUNCTION and METHOD?
3
What is the difference between gettype() vs str replace?
4
What is the difference between global vs $GLOBALS?
5
What is the difference between include and require?


Comments