PHP Interview questions


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

What is the difference between FUNCTION and METHOD?

  1. FUNCTION returns only the name of the function
  2. METHOD returns the name of the class along with the name of the function

Example:

class Slightbook
{
   function doit()
    {
       echo __FUNCTION__;
    }
   function doitagain()
    {
       echo __METHOD__;
    }
}

$obj=new tricks();
$obj->doit();
output will be ---- doit
$obj->doitagain();
output will be ----- tricks::doitagain

 




Next 5 interview question(s)

1
What are Magic constants?
2
How to define constants?
3
What is need for using static variables?
4
What is the difference between global vs $GLOBALS?
5
What is Void?