<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PHP Interview Questions and answers&#187; oop archives  &#8211; interview questions and answers</title>
	<atom:link href="http://www.phpinterviewquestions.com/tag/oop/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phpinterviewquestions.com</link>
	<description>Prepare for your next php based interview with high confidence</description>
	<lastBuildDate>Mon, 26 Sep 2011 08:37:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>What is the use of &#8220;Final class&#8221; and can a final class be an abstract?</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/what-is-the-use-of-final-class-and-can-a-final-class-be-an-abstract/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/what-is-the-use-of-final-class-and-can-a-final-class-be-an-abstract/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 10:46:32 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Advanced level]]></category>
		<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[abstract class]]></category>
		<category><![CDATA[oop]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=464</guid>
		<description><![CDATA[



The &#8220;Final&#8221; keyword is used to make the class uninheritable. So the class or it&#8217;s methods can not be overridden.

final class Class1 {
    // ...
}

class FatalClass extends Class1 {
    // ...
}

$out= new FatalClass();

An Abstract class will never be a final class as an abstract class must be extendable. 
]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 468x60, created 1/27/11 text only */
google_ad_slot = "3922180179";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
The &#8220;Final&#8221; keyword is used to make the class uninheritable. So the class or it&#8217;s methods can not be overridden.</p>
<pre class="brush: php;">
final class Class1 {
    // ...
}

class FatalClass extends Class1 {
    // ...
}

$out= new FatalClass();
</pre>
<p>An Abstract class will never be a final class as an abstract class must be extendable. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/what-is-the-use-of-final-class-and-can-a-final-class-be-an-abstract/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Explain abstract class and its behaviour?</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/explain-abstract-class-and-its-behaviour/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/explain-abstract-class-and-its-behaviour/#comments</comments>
		<pubDate>Tue, 08 Feb 2011 06:34:10 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Expert level]]></category>
		<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[oop]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=453</guid>
		<description><![CDATA[Abstract class is defined as a solitary entity, so other classes can inherit from it. An abstractÂ  class can not be instantiated, only the subclasses of it can have instances. Following is one of the best examples to explain the use of an abstract class and the behavior of it.

 class Fruit {
 private $color;

 [...]]]></description>
			<content:encoded><![CDATA[<p>Abstract class is defined as a solitary entity, so other classes can inherit from it. An abstractÂ  class can not be instantiated, only the subclasses of it can have instances. Following is one of the best examples to explain the use of an abstract class and the behavior of it.</p>
<pre class="brush: php;">
 class Fruit {
 private $color;

 public function eat() {
  //chew
 }

  public function setColor($c) {
   $this-&gt;color = $c;
  }
 }

 class Apple extends Fruit {
  public function eat() {
   //chew until core
  }
 }

 class Orange extends Fruit {
  public function eat() {
   //peel
   //chew
  }
 }
</pre>
<p>Now taste an apple</p>
<pre class="brush: php;">
$apple = new Apple();
$apple-&gt;eat();
</pre>
<p>What&#8217;s the taste of it? Obviously it&#8217;s apple</p>
<p>Now eat a fruit</p>
<pre class="brush: php;">
$fruit = new Fruit();
$fruit-&gt;eat();
</pre>
<p>What&#8217;s the taste of it? It doesn&#8217;t make any sense. does it? Which means the class fruit should not be Instantiable . This is where the abstract class comes into play</p>
<pre class="brush: php;">
abstract class Fruit {
 private $color;

 abstract public function eat()

 public function setColor($c) {
  $this-&gt;color = $c;
 }
}
</pre>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 336x280, created 3/4/10 */
google_ad_slot = "4291231574";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/explain-abstract-class-and-its-behaviour/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oral php interview questions</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/oral-php-interview-questions/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/oral-php-interview-questions/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 10:39:12 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[interviews]]></category>
		<category><![CDATA[oop]]></category>
		<category><![CDATA[sessions]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=334</guid>
		<description><![CDATA[



Here is a list of php question areas that might be asked in an add-hoc oral technical interview.
First of all they will focus on some more basic questions,
- Difference between GET and POST
- Echo and print
- Language constructors and so on&#8230;
Then most likely they would focus on,
- The behaviors of sessions and cookies
- Ways of [...]]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 336x280, created 3/4/10 */
google_ad_slot = "4291231574";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>Here is a list of php question areas that might be asked in an add-hoc oral technical interview.</p>
<p>First of all they will focus on some more basic questions,<br />
- Difference between GET and POST<br />
- Echo and print<br />
- Language constructors and so on&#8230;</p>
<p>Then most likely they would focus on,<br />
- The behaviors of sessions and cookies<br />
- Ways of a session ID can be passed<br />
- Db connection strings and how can it be centralized and stuff like that.<br />
- Difference between normal connection and a persistent connection etc..</p>
<p>Then obviously the interviewer will have to asses on your knowledge in Object Oriented Programming techniques,<br />
- Simply what is a class or object?<br />
- Some definitions on OOP techniques like, Encapsulation, overloading, inheritance.</p>
<p>Also design pattern questions will be asked here.<br />
- Which OOP pattern implements a class that must be instantiated only once in a life span of a script?<br />
- Some more questions on design patterns mostly real world scenarios.<br />
- How design patterns can be used as a mix of more than one pattern?<br />
- Some more discussions related to MVC, Abstract factory, and singleton.</p>
<p>Last but not least they will focus on your knowledge about the security issues, best practices, probably about register global issues and so on. Then the interviewers will focus on more into your CV and about the Frameworks and CMS&#8217;s you have been exposed to.</p>
<p>We will be discussing all of above points one by one in later posts stay tuned.</p>
<p>Cheers !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/oral-php-interview-questions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blue print of an object</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/blue-print-of-an-object-php/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/blue-print-of-an-object-php/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 12:02:36 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[Regular level]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[oop]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=324</guid>
		<description><![CDATA[What is the construct used to define the blueprint of an object called?
A class is a blueprint of an object, which is an instance of a class. 




]]></description>
			<content:encoded><![CDATA[<p>What is the construct used to define the blueprint of an object called?</p>
<p>A class is a blueprint of an object, which is an instance of a class. </p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 468x15, created 4/16/10 */
google_ad_slot = "1994287074";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/blue-print-of-an-object-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Basic object oriented programming</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/basic-object-oriented-programming/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/basic-object-oriented-programming/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 06:34:02 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Advanced level]]></category>
		<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[oop]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=133</guid>
		<description><![CDATA[Basic object orientation in php]]></description>
			<content:encoded><![CDATA[<p>In a general php technical interview, they will ask basic OOP questions like follows, where a high skilled programmer also might get confused sometimes, if he does not know the basics.</p>
<p>class a{<br />
function a(){<br />
echo &#8216;aaaa&#8217;;<br />
}<br />
}</p>
<p>class b extends a{<br />
function b(){<br />
echo &#8216;bbbb&#8217;;<br />
parent::a();<br />
}<br />
}<br />
new b;</p>
<p>The basic idea what we have to identify in this code snippet is,Â  whether the function names work as constructors or not?<br />
Yes, first it will call the function b and then it will call the function a. Which will out put,<br />
<em>bbbbaaaa</em></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 468x15, created 4/16/10 */
google_ad_slot = "1994287074";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/basic-object-oriented-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Object  Orientation with PHP5</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/expert-level-php-interview-questions/object-orientation-with-php5/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/expert-level-php-interview-questions/object-orientation-with-php5/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 05:19:03 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Expert level]]></category>
		<category><![CDATA[oop]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/wordpress/?p=29</guid>
		<description><![CDATA[What are the differences between abstract class and interface?
Abstract class: abstract classes are the class where one or more methods are abstract but not necessarily all method has to be abstract. Abstract methods are the methods, which are declare in its class but not define. The definition of those methods must be in its extending [...]]]></description>
			<content:encoded><![CDATA[<p>What are the differences between abstract class and interface?</p>
<p>Abstract class: abstract classes are the class where one or more methods are abstract but not necessarily all method has to be abstract. Abstract methods are the methods, which are declare in its class but not define. The definition of those methods must be in its extending class.<br />
<br />
Interface: Interfaces are one type of class where all the methods are abstract. That means all the meth</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/expert-level-php-interview-questions/object-orientation-with-php5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Abstract class and interface?</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/expert-level-php-interview-questions/abstract-class-and-interface/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/expert-level-php-interview-questions/abstract-class-and-interface/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 05:19:03 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Expert level]]></category>
		<category><![CDATA[oop]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/wordpress/?p=33</guid>
		<description><![CDATA[What are the differences between abstract class and interface?
Abstract class: abstract classes are the class where one or more methods are abstract but not necessarily all method has to be abstract. Abstract methods are the methods, which are declare in its class but not define. The definition of those methods must be in its extending [...]]]></description>
			<content:encoded><![CDATA[<p>What are the differences between abstract class and interface?</p>
<p><i>Abstract class:</i> abstract classes are the class where one or more methods are abstract but not necessarily all method has to be abstract. Abstract methods are the methods, which are declare in its class but not define. The definition of those methods must be in its extending class.</p>
<p><i>Interface:</i> Interfaces are one type of class where all the methods are abstract. That means all the methods only declared but not defined. All the methods must be define by its implemented class.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/expert-level-php-interview-questions/abstract-class-and-interface/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Predefined classes in PHP</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/expert-level-php-interview-questions/predefined-classes-in-php/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/expert-level-php-interview-questions/predefined-classes-in-php/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 05:19:03 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Expert level]]></category>
		<category><![CDATA[oop]]></category>
		<category><![CDATA[predefined classes]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/wordpress/?p=32</guid>
		<description><![CDATA[List out the predefined classes in PHP?
Directory
stdClass
__PHP_Incomplete_Class
exception
php_user_filter




Best way to check your reserved classes is,
var_dump (get_declared_classes ());
Standard Defined Classes
These classes are defined in the standard set of functions included in the PHP build.
Directory
    The class from which dir is instantiated.
stdClass
    Created by typecasting to object.
__PHP_Incomplete_Class
    Possibly created [...]]]></description>
			<content:encoded><![CDATA[<p>List out the predefined classes in PHP?</p>
<p><strong>Directory</strong></p>
<p><strong>stdClass</strong></p>
<p><strong>__PHP_Incomplete_Class</strong></p>
<p><strong>exception</strong></p>
<p><strong>php_user_filter</strong></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 468x15, created 4/16/10 */
google_ad_slot = "1994287074";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>Best way to check your reserved classes is,<br />
var_dump (get_declared_classes ());</p>
<p>Standard Defined Classes</p>
<p>These classes are defined in the standard set of functions included in the PHP build.</p>
<p><strong>Directory</strong><br />
    The class from which <a target="_blank" href="http://www.php.net/manual/en/class.dir.php">dir</a> is instantiated.<br />
<strong>stdClass</strong><br />
    Created by <a target="_blank" href="http://www.php.net/manual/en/language.types.object.php#language.types.object.casting">typecasting to object</a>.<br />
__<strong>PHP_Incomplete_Class</strong><br />
    Possibly created by unserialize(). </p>
<p>Predefined classes as of PHP 5</p>
<p>These additional predefined classes were introduced in PHP 5.0.0.</p>
<p><a target="_blank" href="http://www.php.net/manual/en/class.exception.php"><strong>exception</strong></a><br />
<strong>php_user_filter</strong> </p>
<p><strong>Closure</strong></p>
<p>The predefined final class <strong>Closure</strong> was introduced in PHP 5.3.0. It is used for internal implementation of <a target="_blank" href="http://www.php.net/manual/en/functions.anonymous.php">anonymous functions</a>.</p>
<p>The class has a constructor forbidding the manual creation of the object (issues E_RECOVERABLE_ERROR) and the __invoke method with the <a target="_blank" href="http://www.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.invoke">calling magic.</a></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 336x280, created 3/4/10 */
google_ad_slot = "4291231574";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/expert-level-php-interview-questions/predefined-classes-in-php/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

