<?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>Thu, 29 Mar 2012 11:47:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Following operations are true or false? (Operator Precedence)</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/operator-precedence/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/operator-precedence/#comments</comments>
		<pubDate>Sun, 18 Mar 2012 08:26:24 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Expert level]]></category>
		<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[Interview]]></category>
		<category><![CDATA[Operator Precedence PHP]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=510</guid>
		<description><![CDATA[$a will out put false, while $b will out put true and what is the reason for this? These are small aspects but very important a programmer must know. In the first phrase it uses &#8220;&#38;&#38;&#8221; operator to bind those two expressions which will give the expected answer. but the second one gives an unexpected [...]]]></description>
			<content:encoded><![CDATA[<pre class="brush: php; title: ; notranslate">
$one = true;
$two = null;
$a = isset($one) &amp;&amp; isset($two);
$b = isset($one) and isset($two);

echo $a;
echo $b;
</pre>
<p>$a will out put false, while $b will out put true and what is the reason for this?</p>
<p>These are small aspects but very important a programmer must know. In the first phrase it uses &#8220;&amp;&amp;&#8221; operator to bind those two expressions which will give the expected answer. but the second one gives an unexpected answer where &#8220;and&#8221; operator is used.</p>
<p>The reason behind is the &#8220;<strong>higher precedence</strong>&#8221; between these 3 operators,<br />
1. &amp;&amp;<br />
2. =<br />
3. and</p>
<p>In the first condition it will first check for the &#8220;&amp;&amp;&#8221; operation and then for the &#8220;=&#8221;</p>
<p>But in the second condition it will first look for the &#8220;=&#8221; operator and then for the &#8220;and&#8221;.</p>
<p>In order to fix this you can force the precedence by using parenthesis as follows,</p>
<pre class="brush: php; title: ; notranslate">

echo $b = (isset($one) and isset($two));
</pre>
<p>More info about &#8220;<a title="PHP Operator Precedence manual" href="http://php.net/manual/en/language.operators.precedence.php" target="_blank">Operator Precedence</a>&#8220;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/operator-precedence/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Write a simple query to get the second largest value of a table column?</title>
		<link>http://www.phpinterviewquestions.com/mysql-interview-questions/query-to-get-the-second-largest-value-of-table-column/</link>
		<comments>http://www.phpinterviewquestions.com/mysql-interview-questions/query-to-get-the-second-largest-value-of-table-column/#comments</comments>
		<pubDate>Sat, 17 Mar 2012 04:54:02 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Advanced level]]></category>
		<category><![CDATA[MySql Questions]]></category>
		<category><![CDATA[limit]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[top]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=505</guid>
		<description><![CDATA[There are many ways that we can write this, But the simplest way in mysql is, SELECT * FROM country ORDER BY id DESC LIMIT 1, 1 plus there are some other methods as well, SELECT * FROM country ORDER BY id DESC LIMIT 1 OFFSET 1 select max(id) from country where id not in(select [...]]]></description>
			<content:encoded><![CDATA[<p>There are many ways that we can write this,</p>
<p>But the simplest way in mysql is,</p>
<ul>
<li>SELECT * FROM country ORDER BY id DESC LIMIT 1, 1</li>
</ul>
<p>plus there are some other methods as well,</p>
<ul>
<li>SELECT * FROM country ORDER BY id DESC LIMIT 1 OFFSET 1</li>
<li>select max(id) from country where id not in(select max(id) from country)</li>
<li>SELECT min(id) FROM (SELECT DISTINCT id FROM country ORDER BY id DESC LIMIT 2) AS t</li>
</ul>
<div>Only in sql server</div>
<ul>
<li>SELECT min([column]) AS [column]<br />
FROM (<br />
SELECT TOP 2 [column]<br />
FROM [Table]<br />
GROUP BY [column]<br />
ORDER BY [column] DESC<br />
) a</p>
<p>&nbsp;</li>
<li>SELECT TOP 1 START AT 2 id from country ORDER BY id</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/mysql-interview-questions/query-to-get-the-second-largest-value-of-table-column/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP String conversions &#8211; what is the out put of the following code snnipet?</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/php-string-conversions-what-is-the-out-put-of-the-following-code-snnipet/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/php-string-conversions-what-is-the-out-put-of-the-following-code-snnipet/#comments</comments>
		<pubDate>Thu, 01 Mar 2012 06:13:47 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[Regular level]]></category>
		<category><![CDATA[String conversions]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=497</guid>
		<description><![CDATA[In the above snippet; it will out put the &#8217;2400 is greater&#8217;, which is correct. but what if the (int) is removed from the snippet. Then the answer will be &#8220;800 is greater&#8221;, which is incorrect. Therefore in calculations it is very important to do the proper conversions.]]></description>
			<content:encoded><![CDATA[<pre class="brush: php; title: ; notranslate">
if((int)&quot;800 &quot; &gt; &quot;2400&quot;) echo '800 is greater';
else echo '2400 is greater';
</pre>
<p>In the above snippet; it will out put the &#8217;2400 is greater&#8217;, which is correct. but what if the (int) is removed from the snippet.</p>
<p>Then the answer will be &#8220;800 is greater&#8221;, which is incorrect.</p>
<p>Therefore in calculations it is very important to do the proper conversions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/php-string-conversions-what-is-the-out-put-of-the-following-code-snnipet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is the newest class introduced for request parameter handling in cakephp2.0?</title>
		<link>http://www.phpinterviewquestions.com/framework-php-interview-questions/request-param-handling-cake2-0/</link>
		<comments>http://www.phpinterviewquestions.com/framework-php-interview-questions/request-param-handling-cake2-0/#comments</comments>
		<pubDate>Sat, 25 Feb 2012 07:09:57 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[Framework questions]]></category>
		<category><![CDATA[cakephp interview]]></category>
		<category><![CDATA[cakeRequest]]></category>
		<category><![CDATA[migration2.0]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=488</guid>
		<description><![CDATA[CakeRequest is the class introduced in cakephp2.0 and it will replace $this->params. The Query parameters or the GET method parameters are handled as follows, The POST method parameters are handled as follows, Also you must remember if an input name has the name &#8220;data&#8221;. it will have to remove the &#8216;data&#8217; prefix.]]></description>
			<content:encoded><![CDATA[<p>CakeRequest is the class introduced in cakephp2.0 and it will replace $this->params.</p>
<p><strong>The Query parameters or the GET method parameters are handled as follows</strong>,</p>
<pre class="brush: php; title: ; notranslate">
// url is /posts/index?page=1&amp;sort=title
$this-&gt;request-&gt;query['page'];

// Also access it via array access
$this-&gt;request['url']['page'];
</pre>
<p><strong>The POST method parameters are handled as follows</strong>,</p>
<pre class="brush: php; title: ; notranslate">
$this-&gt;request-&gt;data['title'];

//if not exist it wil return null
$r = $this-&gt;request-&gt;data['not.exist'];
//$r == null
</pre>
<p>Also you must remember if an input name has the name &#8220;data&#8221;. it will have to remove the &#8216;data&#8217; prefix.</p>
<pre class="brush: php; title: ; notranslate">
// An input with a name attribute equal to 'data[Post][title]' is accessible at
$this-&gt;request-&gt;data['Post']['title'];
</pre>
<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>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/framework-php-interview-questions/request-param-handling-cake2-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When migrating to cakephp2.0, how will the following file names may change?</title>
		<link>http://www.phpinterviewquestions.com/framework-php-interview-questions/cakephp2-migration/</link>
		<comments>http://www.phpinterviewquestions.com/framework-php-interview-questions/cakephp2-migration/#comments</comments>
		<pubDate>Thu, 23 Feb 2012 10:50:20 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[Framework questions]]></category>
		<category><![CDATA[cakephp interview]]></category>
		<category><![CDATA[migration2.0]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=476</guid>
		<description><![CDATA[my_first_controller.php fort.php (a Helper) mess.php (a Component) Answer is, MyFirstController.php FortHelper.php MessComponent.php There are lot of changes in the migration guide2.0 of the cakephp. If you are going for a cakephp specific job interview, you would better go through this before you face the interview. Because there are lot to know if you are facing a [...]]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste">
<div id="_mcePaste">
<ul>
<li>my_first_controller.php</li>
<li>fort.php (a Helper)</li>
<li>mess.php (a Component)</li>
</ul>
<p>Answer is,</p>
<ul>
<li>MyFirstController.php</li>
<li>FortHelper.php</li>
<li>MessComponent.php</li>
</ul>
<p>There are lot of changes in the migration guide2.0 of the cakephp. If you are going for a cakephp specific job interview, you would better go through this before you face the interview. Because there are lot to know if you are facing a migration phase of a cakephp1.3 project.</p>
<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></p>
<p><a title="Cakephp Migration2.0" href="http://book.cakephp.org/2.0/en/appendices/2-0-migration-guide.html" target="_blank">Read here the Migration guide2.0 &#8211; cakephp</a>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/framework-php-interview-questions/cakephp2-migration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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. An Abstract class will never be a final class as an abstract class must be extendable.]]></description>
			<content:encoded><![CDATA[<p>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; title: ; notranslate">
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>
<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>
]]></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. Now taste an apple What&#8217;s [...]]]></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; title: ; notranslate">
 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; title: ; notranslate">
$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; title: ; notranslate">
$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; title: ; notranslate">
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; title: ; notranslate">

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 [...]]]></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[cakephp]]></category>
		<category><![CDATA[Framework questions]]></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 If you are working with CakePHP and havenâ€™t figure it out yet, itâ€™s worth looking through basics.php in the API docs.]]></description>
			<content:encoded><![CDATA[<h3>Following are 2 main shortcut functions available in cakephp</h3>
<pre class="brush: php; title: ; notranslate">
// 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[Out put of the above snippet is? B 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 Out put -&#62; A Main [...]]]></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; title: ; notranslate">
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; title: ; notranslate">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; title: ; notranslate">
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 [...]]]></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 [...]]]></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>
	</channel>
</rss>

