33
Number one question on every PHP interview
I am a PHP programmer and have been on many job interviews. I noticed that on each of them one question always came up.
That question is:
What's the difference between abstract class and interface?
The answer to this question is simple and proves the candidate's familiarity with object-oriented programming.
So let's compare these two:
To declare class to be abstract just simply
abstract
before class
keywordTo declare interface use
interface
keywordinterface Template
{
public function setVariable($name, $var);
public function getHtml($template);
}
33