<?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; Php Interview Questions and answers</title>
	<atom:link href="http://www.phpinterviewquestions.com/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>Write a small function to calculate n to the power of n?</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/write-a-small-function-to-calculate-n-to-the-power-of-n/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/write-a-small-function-to-calculate-n-to-the-power-of-n/#comments</comments>
		<pubDate>Mon, 31 Jan 2011 10:56:34 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Expert level]]></category>
		<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[PHP recursion]]></category>
		<category><![CDATA[pow]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=446</guid>
		<description><![CDATA[In the above question the interviewer is expecting the logic behind the scene (Recursive). Actually he may directly ask you to write a recursive function to calculate N to the power of N, or given number to the power of N. Following is the simplest way that you can write a PHP recursive function for [...]]]></description>
			<content:encoded><![CDATA[<p>In the above question the interviewer is expecting the logic behind the scene (Recursive). Actually he may directly ask you to write a recursive function to calculate N to the power of N, or given number to the power of N. Following is the simplest way that you can write a PHP recursive function for this functionality.</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>
<pre class="brush: php;">

function MyPow($r, $w){
 if($w==0)
  return 1;
 else
  return MyPow($r, $w-1) * $r;
}

echo MyPow(10, 2);
</pre>
<p>Also this functionality substitutes by the <a title="PHP.net" href="http://php.net/manual/en/function.pow.php" target="_blank">pow()</a> function in PHP.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/write-a-small-function-to-calculate-n-to-the-power-of-n/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Explain drupal flow of information among 5 main layers</title>
		<link>http://www.phpinterviewquestions.com/cms-interview-questions/explain-drupal-flow-of-information-among-5-main-layers/</link>
		<comments>http://www.phpinterviewquestions.com/cms-interview-questions/explain-drupal-flow-of-information-among-5-main-layers/#comments</comments>
		<pubDate>Thu, 27 Jan 2011 10:54:21 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[CMS Questions]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[drupal interview]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=425</guid>
		<description><![CDATA[Basically, there are 5 main layers in Drupal where information flows,

Data (Node, ETC)
Modules
Blocks and Menus
User Permissions
Template





Data
Base of the system is collection of Nodes. &#8211; the data pool
Modules
These are functional plugins that are  either part of the Drupal core  (they ship with Drupal) or they are contributed items that have been  created by [...]]]></description>
			<content:encoded><![CDATA[<p>Basically, there are 5 main layers in Drupal where information flows,</p>
<ol>
<li>Data (Node, ETC)</li>
<li>Modules</li>
<li>Blocks and Menus</li>
<li>User Permissions</li>
<li>Template</li>
</ol>
<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 />
<strong>Data</strong><br />
Base of the system is collection of Nodes. &#8211; the data pool</p>
<p><strong>Modules</strong><br />
These are functional plugins that are  either part of the Drupal core  (they ship with Drupal) or they are contributed items that have been  created by members of the Drupal community.</p>
<p><strong>Blocks and Menus</strong><br />
This is the next layer where we find blocks and menus. <em>Blocks often provide the output from a module or can be created to  display whatever you want, and then can be placed in various spots in  your template (theme) layout. Blocks can be configured to output in  various ways, as well as only showing on certain defined pages, or only  for certain defined users.</em></p>
<p><strong>User Permissions</strong><br />
Here is the next layer where settings are configured to determine what different kinds of users are allow to work and see.</p>
<p><strong>Template</strong><br />
This is mainly the site theme or the skin. <em>This is made up predominantly of XHTML and CSS, with some PHP variables intermixed</em></p>
<p>Understanding this flow of information is very important if you are facing A Drupal project targeted interview as the interviewer might test your overall knowledgeÂ  ofÂ  Drupal CMS by asking this sort of questions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/cms-interview-questions/explain-drupal-flow-of-information-among-5-main-layers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mention two useful shorcut functions available globally in cake php</title>
		<link>http://www.phpinterviewquestions.com/framework-php-interview-questions/cakephp-useful-shorcut-fucntions/</link>
		<comments>http://www.phpinterviewquestions.com/framework-php-interview-questions/cakephp-useful-shorcut-fucntions/#comments</comments>
		<pubDate>Wed, 26 Jan 2011 10:32:38 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Framework questions]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[cakephp interview]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=421</guid>
		<description><![CDATA[Following are 2 main shortcut functions available in cakephp

// similar to print_r(), but dumps to the view and
// is disabled if debug isn't &#62; 0 in config.php
pr($anything); 

// returns the correctly internationalized plural or
// singular depending on locale.
__n($singular, $plural, $count, $return);





If you are working with CakePHP and havenâ€™t figure it out yet, itâ€™s worth looking [...]]]></description>
			<content:encoded><![CDATA[<h3>Following are 2 main shortcut functions available in cakephp</h3>
<pre class="brush: php;">
// similar to print_r(), but dumps to the view and
// is disabled if debug isn't &gt; 0 in config.php
pr($anything); 

// returns the correctly internationalized plural or
// singular depending on locale.
__n($singular, $plural, $count, $return);
</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>
<p>If you are working with <a href="http://cakephp.org/" target="_blank">CakePHP </a>and havenâ€™t figure it out yet, itâ€™s worth looking through <a href="http://api.cakephp.org/view_source/basics.php" target="_blank">basics.php</a> in the API docs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/framework-php-interview-questions/cakephp-useful-shorcut-fucntions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What are the two new error levels introduced in PHP5.3?</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/php-error-levels-php5-3/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/php-error-levels-php5-3/#comments</comments>
		<pubDate>Mon, 24 Jan 2011 10:43:25 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Expert level]]></category>
		<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[Deprecated]]></category>
		<category><![CDATA[Error levels]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=408</guid>
		<description><![CDATA[E_DEPRECATED
The E_DEPRECATED error level is used to indicate that a function or feature has been deprecated.
E_USER_DEPRECATED
The E_USER_DEPRECATED level is intended for indicating deprecated features in user code, similarly to the  E_USER_ERROR and E_USER_WARNING levels.




]]></description>
			<content:encoded><![CDATA[<h3>E_DEPRECATED</h3>
<p>The <strong><tt>E_DEPRECATED</tt></strong> error level is used to indicate that a function or feature has been deprecated.</p>
<h3>E_USER_DEPRECATED</h3>
<p>The <strong><tt>E_USER_DEPRECATED</tt></strong> level is intended for indicating deprecated features in user code, similarly to the  <strong><tt>E_USER_ERROR</tt></strong> and <strong><tt>E_USER_WARNING</tt></strong> levels.<br />
<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/php-error-levels-php5-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Late static binding php5</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/late-static-binding-php5/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/late-static-binding-php5/#comments</comments>
		<pubDate>Fri, 08 Oct 2010 08:01:02 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Expert level]]></category>
		<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[php5.3]]></category>
		<category><![CDATA[static binding]]></category>

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


class A {
    public function who() {
        echo __CLASS__;
    }
    public function test() {
        $this-&#62;who();
    }
}

class B extends A {
    public function who() {
   [...]]]></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>
<pre class="brush: php;">
class A {
    public function who() {
        echo __CLASS__;
    }
    public function test() {
        $this-&gt;who();
    }
}

class B extends A {
    public function who() {
        echo __CLASS__;
    }
}
$obj = new B;
$obj-&gt;test();
</pre>
<p><strong>Out put of the above snippet is? B</strong> This is mainly because we have the object instance named as $this is for the class B, though the function is instantiated inside class A. But, If you need the expected output which is &#8220;A&#8221;, we can call them statically as follows </p>
<pre class="brush: php;">class A {
    public static function who() {
        echo __CLASS__;
    }
    public static function test() {
        self::who();
    }
}

class B extends A {
    public static function who() {
        echo __CLASS__;
    }
}

B::test();
</pre>
<p><strong>Out put -&gt; A</strong></p>
<p>Main limitation of self:: or __CLASS__ are resolved using the class in which the function belongs, as in where it was defined. By introducing <strong>late static binding</strong> this limitation has been resolved as follows,</p>
<pre class="brush: php;">
class A {
    public static function who() {
        echo __CLASS__;
    }
    public static function test() {
        static::who(); // Here comes Late Static Bindings
    }
}

class B extends A {
    public static function who() {
        echo __CLASS__;
    }
}

B::test();
</pre>
<p><strong>Out put -&gt; B</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/late-static-binding-php5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>back to the basics</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/back-to-the-basics/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/back-to-the-basics/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 10:38:24 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[basics]]></category>

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

This is just a quick note about how you must prepare for your technical interview whether it&#8217;s a face to face or a written.
Before you prepare for a technical interview you must re-work on your basics in the first place. if you are not sure enough don&#8217;t go to the interview. Prepare well for your [...]]]></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>This is just a quick note about how you must prepare for your technical interview whether it&#8217;s a face to face or a written.<br />
Before you prepare for a technical interview you must re-work on your basics in the first place. if you are not sure enough don&#8217;t go to the interview. Prepare well for your next interview. It will help you a lotÂ  <img src='http://www.phpinterviewquestions.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>For an instance at least work on following aspects,</p>
<ul>
<li><strong>Client Server</strong>Â  &#8211; &gt; What is client server architecture? Basic requesting methods to the server?</li>
<li><strong>Sessions</strong>Â  -&gt; What is a session? Where sessions are stored? How session reference is carried in the browser(client) side?</li>
<li><strong>OOP</strong>Â Â Â Â  -&gt; What is a class? what is overloading? what is overriding and how you do these with examples?</li>
<li><strong>XML</strong>Â Â Â  -&gt; What is xml? and what&#8217;s the use of it?</li>
<li><strong>AJAX</strong> -&gt; What is ajax? if you use 3rd party tool at least know the basic functions.</li>
<li><strong>Frameworks</strong> &#8211; &gt; Design patterns used? MVC? Explain cakephp, zend etc</li>
<li><strong>CMS</strong>-&gt; At least the knowledge of integrating a template. Joomla, Drupal, Magento</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/back-to-the-basics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sessions and cookies</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/sessions-and-cookies/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/sessions-and-cookies/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 10:51:35 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[Regular level]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php security]]></category>
		<category><![CDATA[sessions]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=338</guid>
		<description><![CDATA[Face to face technical interviews, questions related to sessions and cookies will pop up regularly. Since most of the developers are familiar with these sort of basic php questions they tend to ask more tricky questions, but if you have the correct idea then it is easy to answer any of those tricky questions. Let&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Face to face technical interviews, questions related to sessions and cookies will pop up regularly. Since most of the developers are familiar with these sort of basic php questions they tend to ask more tricky questions, but if you have the correct idea then it is easy to answer any of those tricky questions. Let&#8217;s have a look on potential questions,</p>
<dl>
<dt>Where is the sessions are stored?</dt>
<dd>Sessions are stored in server side and it is accessed by a unique id which is known as the session-id where each user/visitor is assigned when they access your website.</dd>
<dt>How the session-id is propagated within your website?</dt>
<dd>Basically, there are 2 methods either <strong>store it in a cookie</strong> or <strong>propagated in the URL</strong>. </dd>
</dl>
<p>Session security questions will not be asked in an entry level interviews but, if an advanced level candidate who has experience in developing robust and secured application must know about the vulnerabilities.</p>
<p>Leaking out an existing session-id to a third party is very risky if the session is filled with more important information.<br />
Main two methods of vulnerabilities are,<br />
- When the session-id is carrying in URLs<br />
If an external link from your site, a URL with the id might be stored in the external site&#8217;s referrer log.</p>
<p>- Active attacker might listen to network traffic<br />
While the session-id flows over the network and if it is not encrypted an active listener might grab it. The best solution is to implement SSL and make it a must for all the users.<br />
<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/sessions-and-cookies/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>php security interview questions</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/php-security-interview-questions/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/php-security-interview-questions/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 11:11:55 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Advanced level]]></category>
		<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[php security]]></category>
		<category><![CDATA[register global]]></category>

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

Consider the following code snippet. Is this code acceptable from a security standpoint?
Assume that the $action and $data variables are designed to be accepted from the user and
register_globals is enabled.

&#60;?php
if(isUserAdmin()) {
 $isAdmin = true;
}
$data = validate_and_return_input($data);
switch($action){
 case 'add':
 addSomething($data);
 break;
case 'delete':
 if($isAdmin) {
 deleteSomething($data);
 }
break;
case 'edit':
 if($isAdmin) {
 editSomething($data);
 }
break;
default:
print â€œBad Action.â€;
}
?&#62;

A. Yes, it is [...]]]></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>Consider the following code snippet. Is this code acceptable from a security standpoint?<br />
Assume that the $action and $data variables are designed to be accepted from the user and<br />
register_globals is enabled.</p>
<pre class="brush: php;">
&lt;?php
if(isUserAdmin()) {
 $isAdmin = true;
}
$data = validate_and_return_input($data);
switch($action){
 case 'add':
 addSomething($data);
 break;
case 'delete':
 if($isAdmin) {
 deleteSomething($data);
 }
break;
case 'edit':
 if($isAdmin) {
 editSomething($data);
 }
break;
default:
print â€œBad Action.â€;
}
?&gt;
</pre>
<p>A. Yes, it is secure. It checks for $isAdmin to be True before executing protected operations<br />
B. No, it is not secure because it doesnâ€™t make sure $action is valid input<br />
<strong>C. No, it is not secure because $isAdmin can be hijacked by exploiting register_globals</strong><br />
D. Yes, it is secure because it validates the user-data $data<br />
E. Both A and B</p>
<p>The correct answer is C. This code is, by any means, not secure! In fact, it is the classic security exploit of PHP scripts using the register_globals configuration directive. The problem lies in the $isAdmin variable: although this is clearly a Boolean value, it is only set in the event that the user is an Admin and not set at all if the user is not. Because register_globals is enabled, by simply appending that variable to the end of the URL as a GET parameter, a malicious user could easily impersonate an administrator:</p>
<p>http://www.example.com/action.php?action=delete&#038;data=foo&#038;isAdmin=1</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/php-security-interview-questions/feed/</wfw:commentRss>
		<slash:comments>3</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>why cakephp? interview question</title>
		<link>http://www.phpinterviewquestions.com/framework-php-interview-questions/why-cakephp-interview-question/</link>
		<comments>http://www.phpinterviewquestions.com/framework-php-interview-questions/why-cakephp-interview-question/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 06:24:17 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Framework questions]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[cakephp interview]]></category>
		<category><![CDATA[Interview]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=320</guid>
		<description><![CDATA[In an interview the interviewer asked,
Why we use cakephp? We can just have our own structure and keep developing projects without making things more complicated. Why cake?
The best answer for this question from the cakephp Cookbook is,


		

		

		
We don&#8217;t have to re-invent the wheel. Every time we sit for a new project, we have a more [...]]]></description>
			<content:encoded><![CDATA[<p>In an interview the interviewer asked,</p>
<blockquote><p>Why we use cakephp? We can just have our own structure and keep developing projects without making things more complicated. Why cake?</p></blockquote>
<p>The best answer for this question from the cakephp Cookbook is,</p>
<p><script type="text/javascript"><!--

		google_ad_client = "pub-8695027799979044";

		/* 468x15, created 3/2/10 */

		google_ad_slot = "0865002888";

		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>We don&#8217;t have to re-invent the wheel. Every time we sit for a new project, we have a more structural way of developing the project with an already installed development environment and we just have to start our rapid application straight a way with the business logic.</p>
<p>Some of the key features the framework provides are,<br />
- MVC structure<br />
- Code generation<br />
- CRUD for database interaction<br />
- Application scaffolding<br />
- Code generation<br />
- Built-in validation<br />
- Data sanitation<br />
- Flexible casching<br />
- Localization</p>
<p>and lot <a href="http://book.cakephp.org/view/8/What-is-CakePHP-Why-Use-it" target="_blank">more&#8230;&#8230;&#8230;</a></p>
<p><code>Our primary goal is to enable you to work in a structured and rapid mannerâ€“without loss of flexibility</code> &#8211; by cakephp org.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/framework-php-interview-questions/why-cakephp-interview-question/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MVC structure- cakephp</title>
		<link>http://www.phpinterviewquestions.com/framework-php-interview-questions/mvc-structure-cakephp-interview/</link>
		<comments>http://www.phpinterviewquestions.com/framework-php-interview-questions/mvc-structure-cakephp-interview/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 12:12:10 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Framework questions]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[cakephp interview]]></category>
		<category><![CDATA[mvc]]></category>

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

What is meant by MVC (Model View Controller)?
MODEL VIEW CONTROLLER, is a software architecture, currently considered an architectural pattern used in software engineering.
This isolates business logic from presentation logic.
1. The Model represents the application data
2. The View renders a presentation of model data
3. The Controller handles and routes requests made by the client
]]></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>What is meant by MVC (Model View Controller)?</p>
<p>MODEL VIEW CONTROLLER, is a software architecture, currently considered an architectural pattern used in software engineering.<br />
This isolates business logic from presentation logic.</p>
<p>1. The Model represents the application data<br />
2. The View renders a presentation of model data<br />
3. The Controller handles and routes requests made by the client<br /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/framework-php-interview-questions/mvc-structure-cakephp-interview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Strings and regular expressions</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/strings-and-regular-expressions-php-interview-questions/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/strings-and-regular-expressions-php-interview-questions/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 12:08:03 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[Regular level]]></category>
		<category><![CDATA[Interview]]></category>
		<category><![CDATA[Regex]]></category>
		<category><![CDATA[Strings]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=284</guid>
		<description><![CDATA[What will be the answer of the following code snippet?

echo 'Testing ' . 1 + 2 . '45';

Simply you will give the answer as : Testing 345
But the answer is  : 245
That is because you can not sum a number with a string. The first part, before the plus mark is a string though [...]]]></description>
			<content:encoded><![CDATA[<p>What will be the answer of the following code snippet?</p>
<pre class="brush: php;">
echo 'Testing ' . 1 + 2 . '45';
</pre>
<p>Simply you will give the answer as : Testing 345</p>
<p>But the answer is  : 245</p>
<p>That is because you can not sum a number with a string. The first part, before the plus mark is a string though there is 1 there.<br />
So engine will simply get it as 0 and the latter part as 245. so answer will be 245.</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/strings-and-regular-expressions-php-interview-questions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

