Priti's Technical Corner

December 29, 2008

PHP Interview Questions

Filed under: Interview, PHP — Tags: , , , , , — pritisolanki @ 4:10 pm

Questions 1: Can we get  list of all constant in out program defined by define();
Answer 1: Yes, by get_defined_constants() we can list the constant and values.

Question2: If two interface have same method name can we implement both simultaneously.
Answer 2:No, it will create ambiguity

Question 3:what is Overloading in PHP

Answer 3:Overloading in PHP means to create methods and members dynamically.All overloading method must be defined as public.

Question 4: what is Factory pattern?

Answer 4: The Factory pattern allows for the instantiation of objects at run time. It is called a Factory Pattern since it is responsible for “manufacturing” an object.

Question 5: what is Singleton pattern?

Answer 5 :The Singleton pattern applies to situations in which there needs to be a single instance of a class. The most common example of this is a database connection.

Question6:How you can control the php script output?

Answer 6:By using output bufferring function like ob_start() and ob_end_flush() to control the script’s output.

1 Comment »

  1. I find this blog very useful for PHP aspirants like me, who always need some kind of PHP discussion and interview questions.
    I appreciate the effort taken by the author to post the important questions, and i suggest to post more and more questions and also give more publicity to the blog, so that more members can benefit from it.

    Comment by Very useful — December 30, 2008 @ 6:29 pm

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at

%d bloggers like this: