<?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>C &#8211; stoimen&#039;s web log</title>
	<atom:link href="/tag/c/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>on web development</description>
	<lastBuildDate>Tue, 13 Feb 2018 08:18:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.3</generator>
	<item>
		<title>It&#8217;s Not True that PHP Arrays are Copied by Value</title>
		<link>/2012/08/17/its-not-true-that-php-arrays-are-copied-by-value/</link>
		<comments>/2012/08/17/its-not-true-that-php-arrays-are-copied-by-value/#comments</comments>
		<pubDate>Fri, 17 Aug 2012 14:08:32 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[zend framework]]></category>
		<category><![CDATA[Array slicing]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[C programming language]]></category>
		<category><![CDATA[Comparison of programming languages]]></category>
		<category><![CDATA[J]]></category>

		<guid isPermaLink="false">/?p=3288</guid>
		<description><![CDATA[PHP, Arrays &#038; Passing by Reference Do you know that objects in PHP5 are passed by reference, while arrays and other scalar variables are passed by value? Yes, you know it, but it&#8217;s not exactly true. Let&#8217;s see some example and let&#8217;s try to answer few questions. // depending on the machine but both lines &#8230; <a href="/2012/08/17/its-not-true-that-php-arrays-are-copied-by-value/" class="more-link">Continue reading <span class="screen-reader-text">It&#8217;s Not True that PHP Arrays are Copied by Value</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2011/10/19/thing-to-know-about-php-arrays/" rel="bookmark" title="Thing to Know About PHP Arrays">Thing to Know About PHP Arrays </a></li>
<li><a href="/2012/07/24/php-arrays-or-linked-lists/" rel="bookmark" title="PHP: Arrays or Linked Lists?">PHP: Arrays or Linked Lists? </a></li>
<li><a href="/2010/05/19/php-associative-arrays-coding-style/" rel="bookmark" title="PHP Associative Arrays Coding Style">PHP Associative Arrays Coding Style </a></li>
<li><a href="/2011/10/27/object-cloning-and-passing-by-reference-in-php/" rel="bookmark" title="Object Cloning and Passing by Reference in PHP">Object Cloning and Passing by Reference in PHP </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>PHP, Arrays &#038; Passing by Reference</h2>
<p>Do you know that objects in PHP5 are passed by reference, while arrays and other scalar variables are passed by value? Yes, you know it, but it&#8217;s not exactly true. Let&#8217;s see some example and let&#8217;s try to answer few questions.</p>
<pre lang="PHP">
// depending on the machine but both lines return
// expectedly equal values: 331208

// 331208
echo memory_get_usage();
echo memory_get_usage();
</pre>
<p>These two lines of code, expectedly return the same value (in my case 331208), which shows us that because nothing happened in between them the memory usage isn&#8217;t growing. Let&#8217;s now put some code in between them.</p>
<pre lang="PHP">
echo memory_get_usage(); // 331616
$a = 10;
echo memory_get_usage(); // 331696
</pre>
<p><span id="more-3288"></span></p>
<p>Now because of the variable $a, we get a little more memory consuption! The same thing (with even more memory usage) happens if we have an array initialization.</p>
<pre lang="PHP">
echo memory_get_usage(); // 332128
$a = array(1, 2, 3, 'hello', 'world');
echo memory_get_usage(); // 332728
</pre>
<p>OK, now we see how much memory PHP is using for this very simple and small array. If we copy this array, we&#8217;d expect PHP to take twice as much memory, but that&#8217;s not the case!</p>
<pre lang="PHP">
echo memory_get_usage(); // 332336
$a = array(1, 2, 3, 'hello', 'world');
$b = $a;
echo memory_get_usage(); // 332984
</pre>
<p>Actually if we had $b = 10; this will consume more!!! memory than the code above.</p>
<pre lang="PHP">
echo memory_get_usage(); // 332336
$a = array(1, 2, 3, 'hello', 'world');
$b = 10;
echo memory_get_usage(); // 333016
</pre>
<p>This is simply because in the first case <strong>$b wasn&#8217;t a copy</strong> of $a, while in the second case we have a brand new variable on the ground, which, of course, requires memory.</p>
<h2>Why Arrays aren&#8217;t Copied?</h2>
<p>Actually now we see that copying by reference and by value is absolutely the same.</p>
<pre lang="PHP">
$a = array(1, 2, 3, 'hello', 'world');

// this line is exactly the same as ...
$b = $a;

// this line
$b = &$a;
</pre>
<p>That is because in both case the array is passed by reference. It is copied once we make changes to $b. Then in the first case $b becomes a copy of $a and it&#8217;s changed, while in the second case $b is exactly the same array as $a and every change to $b changes $a as well.</p>
<pre lang="PHP">
echo memory_get_usage();
$a = array(1, 2, 3, 'hello', 'world');
echo memory_get_usage();
$b = $a;
$b = array(1, 2, 3, 'goodby', 'world');
echo memory_get_usage();
</pre>
<h2>Conclusion</h2>
<p>If we take an example from Zend Framework, where often we work with arrays that are passed to the view as a &#8220;copy&#8221;:</p>
<pre lang="PHP">
$a = array(1, 2, 3, 'hello', 'world');
$this->view->a = $a; // this is NOT a copy
</pre>
<p>This will not consume more memory!!! The only way to make your application more memory inefficient is to change directly the $this->view->a array, so be careful!</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2011/10/19/thing-to-know-about-php-arrays/" rel="bookmark" title="Thing to Know About PHP Arrays">Thing to Know About PHP Arrays </a></li>
<li><a href="/2012/07/24/php-arrays-or-linked-lists/" rel="bookmark" title="PHP: Arrays or Linked Lists?">PHP: Arrays or Linked Lists? </a></li>
<li><a href="/2010/05/19/php-associative-arrays-coding-style/" rel="bookmark" title="PHP Associative Arrays Coding Style">PHP Associative Arrays Coding Style </a></li>
<li><a href="/2011/10/27/object-cloning-and-passing-by-reference-in-php/" rel="bookmark" title="Object Cloning and Passing by Reference in PHP">Object Cloning and Passing by Reference in PHP </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2012/08/17/its-not-true-that-php-arrays-are-copied-by-value/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PHP: Arrays or Linked Lists?</title>
		<link>/2012/07/24/php-arrays-or-linked-lists/</link>
		<comments>/2012/07/24/php-arrays-or-linked-lists/#comments</comments>
		<pubDate>Tue, 24 Jul 2012 11:25:20 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[data structures]]></category>
		<category><![CDATA[$_head]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Comparison of programming languages]]></category>
		<category><![CDATA[Data structures]]></category>
		<category><![CDATA[Data types]]></category>
		<category><![CDATA[Extinction]]></category>
		<category><![CDATA[Foreach]]></category>
		<category><![CDATA[Linked list]]></category>
		<category><![CDATA[List]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Pointer]]></category>
		<category><![CDATA[Stack]]></category>
		<category><![CDATA[UnShuffle sort]]></category>

		<guid isPermaLink="false">/?p=3259</guid>
		<description><![CDATA[Arrays vs. Linked List If we talk about arrays and linked lists we know the pros and cons about both of them. No matter which programming language we use arrays benefit from direct access to its items, while linked lists are more memory efficient for particular tasks. The items of a linked list keep a &#8230; <a href="/2012/07/24/php-arrays-or-linked-lists/" class="more-link">Continue reading <span class="screen-reader-text">PHP: Arrays or Linked Lists?</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2012/06/14/computer-algorithms-linked-list-data-structure/" rel="bookmark" title="Computer Algorithms: Linked List">Computer Algorithms: Linked List </a></li>
<li><a href="/2012/07/17/computer-algorithms-detecting-and-breaking-a-loop-in-a-linked-list/" rel="bookmark" title="Computer Algorithms: Detecting and Breaking a Loop in a Linked List">Computer Algorithms: Detecting and Breaking a Loop in a Linked List </a></li>
<li><a href="/2010/09/29/construct-a-sorted-php-linked-list/" rel="bookmark" title="Construct a Sorted PHP Linked List">Construct a Sorted PHP Linked List </a></li>
<li><a href="/2012/08/17/its-not-true-that-php-arrays-are-copied-by-value/" rel="bookmark" title="It&#8217;s Not True that PHP Arrays are Copied by Value">It&#8217;s Not True that PHP Arrays are Copied by Value </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>Arrays vs. Linked List</h2>
<p>If we talk about arrays and linked lists we know the pros and cons about both of them. No matter which programming language we use arrays benefit from direct access to its items, while linked lists are more memory efficient for particular tasks.</p>
<figure id="attachment_3279" style="width: 620px" class="wp-caption alignnone"><a href="/wp-content/uploads/2012/07/Array-Linked-List.png"><img src="/wp-content/uploads/2012/07/Array-Linked-List.png" alt="Array &amp; Linked List" title="Array &amp; Linked List" width="620" height="314" class="size-full wp-image-3279" srcset="/wp-content/uploads/2012/07/Array-Linked-List.png 620w, /wp-content/uploads/2012/07/Array-Linked-List-300x151.png 300w" sizes="(max-width: 620px) 100vw, 620px" /></a><figcaption class="wp-caption-text">Array &#038; Linked List</figcaption></figure>
<p>The items of a linked list keep a reference to their successor, so we can easily walk through the entire list. However we don&#8217;t have direct access to its elements. Thus we can&#8217;t go directly to its middle element! Even more &#8211; in particular implementations of a linked list we don&#8217;t know its length. But in some cases linked lists are far more effective than arrays. For instance reversing an array of non-numeric values require constant additional memory, but also requires n/2 exchanges. The same taks using linked lists is not only performed in linear time, but doesn&#8217;t require any additional memory. The only thing we need to do is to reverse the links &#8211; no movement of values and the items remain at the same place in the memory. </p>
<p>Merging of two arrays often require more space (proportional of the space of the two arrays) or many exchanges in case we try to do it in place. The same task on linked lists is far more effective with only changing pointers and without moving the values.<span id="more-3259"></span></p>
<h2>Arrays or Linked Lists are More Memory Efficient</h2>
<p>Many developers consider linked lists as something used only in college, but actually they can be very useful in practice as well. However how practically useful they are? Let&#8217;s see the following PHP experiment.</p>
<p>Here we have one class called &#8220;Item&#8221;, which is designed to keep only one integer value as its key and to point to its successor. Practically this class is designed to be used by a singly linked list, but let say we put some of these objects into an array and the same amount of the &#8220;Item&#8221; objects into a linked lists so what are the results?</p>
<p>First let&#8217;s see the code!</p>
<pre lang="PHP">
class Item
{
    protected $_key = '';
    protected $_next = null;
    
    public function __construct($key)
    {
        $this->_key = $key;
    }
    
    public function setNext(&$next) { $this->_next = $next; }
    public function &getNext() { return $this->_next; }
    
    public function setKey($key) { $this->_key = $key; }
    public function getKey() { return $this->_key; }
    
    public function __toString()
    {
        return $this->_key . "\n";
    }
}
</pre>
<p>This is the &#8220;Item&#8221; class and here we have the Linked_List class. As you can see this is the very basic implementation of a linked list with only one &#8220;insert&#8221; method and the magic __toString() in order to print the entire list. The insert method pushes an item at the end of the list thus the insertion is O(1).</p>
<pre lang="PHP">
class Linked_List 
{
    protected $_head = null;
    protected $_tail = null;
    
    public function insert($item)
    {
        if ($this->_head == null) {
            $this->_head = $item;
            $this->_tail = $item;
            return;
        }
        
        $this->_tail->setNext($item);
        $this->_tail = $item;
    }
    
    public function __toString()
    {
        $current = $this->_head;
        $output = '';
        
        while ($current) {
            $output .= $current->getKey() . "\n";
            $current = $current->getNext();
        }
        
        return $output;
    }
}
</pre>
<p>Now let&#8217;s see the creation of an array with N objects of class &#8220;Item&#8221;.</p>
<pre lang="PHP">
$n = 10000;
$a = array();
for ($i = 0; $i < $n; $i++) {
    $a[$i] = new Item($i);
}
</pre>
<p>The same thing but using the Linked_List class follows on the lines below.</p>
<pre lang="PHP">
$n = 10000;
$a = new Linked_List();
for ($i = 0; $i < $n; $i++) {
    $a->insert(new Item($i));
}
</pre>
<h2>And the Winner is ...</h2>
<p>More memory efficient is ... the linked list! On the next chart we can see the results. It's clear that for 10K objects the array uses nearly 1MB more memory than the linked list! </p>
<figure id="attachment_3280" style="width: 600px" class="wp-caption alignnone"><a href="/wp-content/uploads/2012/07/Array-vs.-Linked-List-Chart.png"><img src="/wp-content/uploads/2012/07/Array-vs.-Linked-List-Chart.png" alt="Array vs. Linked List Chart" title="Array vs. Linked List Chart" width="600" height="371" class="size-full wp-image-3280" srcset="/wp-content/uploads/2012/07/Array-vs.-Linked-List-Chart.png 600w, /wp-content/uploads/2012/07/Array-vs.-Linked-List-Chart-300x185.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></a><figcaption class="wp-caption-text">&nbsp;</figcaption></figure>
<p>So what do you think now? Will you use linked list in your code or not?</p>
<h2>Final Words</h2>
<p>Although the linked list seems to be more memory efficient we don't have direct acess to it's items. In the same time often we don't need direct access, we just need to walk through the array, which doesn't benefit from the direct access. In PHP this is usally done with some loop construction as "foreach". So why we have such results in the experiment above. First our linked list is really very basic. It doesn't have any functionality, which in fact shouldn't affect memory usage much more. The array in the other hand keeps indexes for each of its items so this results in additional space. This explains a bit the victory of the linked list in the memory efficiency test.</p>
<p>In the other hand PHP can't have the full benefit of using linked lists, trees and other data structures since it keeps them in memory only for the request. In this case C, C++, Java loads a data structure in memory till the software runs so unfortunately coding complex data structures in PHP doesn't look as a great option. Indeed here we have an entire "Item" class only to keep an integer. Instead we can use an array of integers! </p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2012/06/14/computer-algorithms-linked-list-data-structure/" rel="bookmark" title="Computer Algorithms: Linked List">Computer Algorithms: Linked List </a></li>
<li><a href="/2012/07/17/computer-algorithms-detecting-and-breaking-a-loop-in-a-linked-list/" rel="bookmark" title="Computer Algorithms: Detecting and Breaking a Loop in a Linked List">Computer Algorithms: Detecting and Breaking a Loop in a Linked List </a></li>
<li><a href="/2010/09/29/construct-a-sorted-php-linked-list/" rel="bookmark" title="Construct a Sorted PHP Linked List">Construct a Sorted PHP Linked List </a></li>
<li><a href="/2012/08/17/its-not-true-that-php-arrays-are-copied-by-value/" rel="bookmark" title="It&#8217;s Not True that PHP Arrays are Copied by Value">It&#8217;s Not True that PHP Arrays are Copied by Value </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2012/07/24/php-arrays-or-linked-lists/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>PHP Strings Don&#8217;t Need Quotes</title>
		<link>/2012/04/26/php-strings-dont-need-quotes/</link>
		<comments>/2012/04/26/php-strings-dont-need-quotes/#comments</comments>
		<pubDate>Thu, 26 Apr 2012 13:52:53 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Computer programming]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Cross-platform software]]></category>
		<category><![CDATA[Curly bracket programming languages]]></category>
		<category><![CDATA[PHP interpreter]]></category>
		<category><![CDATA[PHP programming language]]></category>
		<category><![CDATA[Procedural programming languages]]></category>
		<category><![CDATA[Programming language]]></category>
		<category><![CDATA[Scripting languages]]></category>
		<category><![CDATA[Social Issues]]></category>
		<category><![CDATA[Software engineering]]></category>
		<category><![CDATA[String]]></category>

		<guid isPermaLink="false">/?p=3017</guid>
		<description><![CDATA[I bet you didn&#8217;t know that PHP strings don&#8217;t need quotes! Indeed PHP developers work with strings with either single or double quotes, but actually in some cases you don&#8217;t need them. PHP by Book Here&#8217;s how PHP developer declare a string, which is something very common in any programming language. $my_var = 'hello world'; &#8230; <a href="/2012/04/26/php-strings-dont-need-quotes/" class="more-link">Continue reading <span class="screen-reader-text">PHP Strings Don&#8217;t Need Quotes</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2011/07/12/a-javascript-trick-you-should-know/" rel="bookmark" title="A JavaScript Trick You Should Know">A JavaScript Trick You Should Know </a></li>
<li><a href="/2010/03/10/php-if-else-endif-statements/" rel="bookmark" title="PHP if-else-endif Statements">PHP if-else-endif Statements </a></li>
<li><a href="/2011/08/18/powerful-php-less-known-string-manipulation/" rel="bookmark" title="Powerful PHP: Less Known String Manipulation">Powerful PHP: Less Known String Manipulation </a></li>
<li><a href="/2010/06/10/json-and-zend-framework-zend_json/" rel="bookmark" title="JSON and Zend Framework? &#8211; Zend_Json">JSON and Zend Framework? &#8211; Zend_Json </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>I bet you didn&#8217;t know that PHP strings don&#8217;t need quotes! Indeed PHP developers work with strings with either single or double quotes, but actually in some cases you don&#8217;t need them.</p>
<h2>PHP by Book</h2>
<p>Here&#8217;s how PHP developer declare a string, which is something very common in any programming language.</p>
<pre lang="PHP">
$my_var = 'hello world';
// or
$my_var = "hello world";
</pre>
<h2>PHP Tricks</h2>
<p>What if you do the following:</p>
<pre lang="PHP">
echo hello;
</pre>
<p>That appears to be correct &#8230; Well, it&#8217;s not absolutely correct. You&#8217;ll be &#8220;noticed&#8221;.</p>
<pre lang="PHP">
// Notice: Use of undefined constant hello
echo hello;
</pre>
<p>However if you disable error reporting, the code will be completely fine.</p>
<pre lang="PHP">
error_reporting(0);

// no problem now
echo hello;
</pre>
<h2>Variations</h2>
<p>What follows from the thing above is that you can use strings without quotes:</p>
<pre lang="PHP">
// hello
echo hello;

// hello world (concatenated)
echo hello . ' world';

// helloworld
echo hello . world;
</pre>
<p>However you can&#8217;t have spaces and most of the &#8220;special&#8221; symbols.</p>
<pre lang="PHP">
// syntax error
echo hello world;

// syntax error
echo hello!;
</pre>
<h2>Final Words</h2>
<p>Although you can do this in PHP, that is completely wrong. The code becomes more difficult to read and understand. In the second place you can miss a $ sign in front of a variable declaration and thus the PHP interpreter will assume this is a string. So disable error reporting isn&#8217;t so great sometimes.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2011/07/12/a-javascript-trick-you-should-know/" rel="bookmark" title="A JavaScript Trick You Should Know">A JavaScript Trick You Should Know </a></li>
<li><a href="/2010/03/10/php-if-else-endif-statements/" rel="bookmark" title="PHP if-else-endif Statements">PHP if-else-endif Statements </a></li>
<li><a href="/2011/08/18/powerful-php-less-known-string-manipulation/" rel="bookmark" title="Powerful PHP: Less Known String Manipulation">Powerful PHP: Less Known String Manipulation </a></li>
<li><a href="/2010/06/10/json-and-zend-framework-zend_json/" rel="bookmark" title="JSON and Zend Framework? &#8211; Zend_Json">JSON and Zend Framework? &#8211; Zend_Json </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2012/04/26/php-strings-dont-need-quotes/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>You think you know PHP. Quiz Results!</title>
		<link>/2012/03/16/you-think-you-know-php-quiz-results/</link>
		<comments>/2012/03/16/you-think-you-know-php-quiz-results/#respond</comments>
		<pubDate>Fri, 16 Mar 2012 14:30:11 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[quiz]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Ello]]></category>
		<category><![CDATA[Foo bar]]></category>
		<category><![CDATA[Foo bar Foo Bar]]></category>
		<category><![CDATA[Foobar]]></category>
		<category><![CDATA[String]]></category>

		<guid isPermaLink="false">/?p=2919</guid>
		<description><![CDATA[With 400+ answers here are the results. First I want to thank you for participating in the quiz and congrats for the 16 users that answered correctly to all the questions! 1. What will be the output of the following code? echo date('Y-m-d', strtotime('-1 month ago')); Error One month ago from the current date and &#8230; <a href="/2012/03/16/you-think-you-know-php-quiz-results/" class="more-link">Continue reading <span class="screen-reader-text">You think you know PHP. Quiz Results!</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2012/03/07/you-think-you-know-javascript-quiz-results/" rel="bookmark" title="You think you know javascript. Quiz results!">You think you know javascript. Quiz results! </a></li>
<li><a href="/2012/05/09/you-think-you-know-algorithms-quiz-results-2/" rel="bookmark" title="You think you know algorithms. Quiz results!">You think you know algorithms. Quiz results! </a></li>
<li><a href="/2012/02/29/you-think-you-know-algorithms-quiz-results/" rel="bookmark" title="You think you know algorithms. Quiz results!">You think you know algorithms. Quiz results! </a></li>
<li><a href="/2010/09/17/5-php-string-functions-you-need-to-know/" rel="bookmark" title="5 PHP String Functions You Need to Know">5 PHP String Functions You Need to Know </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>With 400+ answers here are the results. First I want to thank you for participating in the quiz and congrats for the <strong>16</strong> users that answered correctly to all the questions!</p>
<h3>1. What will be the output of the following code?</h3>
<pre lang="PHP">echo date('Y-m-d', strtotime('-1 month ago'));</pre>
<ul>
<li>Error</li>
<li>One month ago from the current date and time</li>
<li>One month in the future from the current date and time <span style="color: #339966;">correct answer</span> (<a href="/2011/11/04/how-to-check-if-a-date-is-more-or-less-than-a-month-ago-with-php/" title="How to Check if a Date is More or Less Than a Month Ago with PHP">ref</a>)</li>
</ul>
<p><figure id="attachment_2925" style="width: 600px" class="wp-caption alignnone"><a href="/wp-content/uploads/2012/03/answer11.png"><img src="/wp-content/uploads/2012/03/answer11.png" alt="Answers of the first question" title="Answers of the first question" width="600" height="371" class="size-full wp-image-2925" srcset="/wp-content/uploads/2012/03/answer11.png 600w, /wp-content/uploads/2012/03/answer11-300x185.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></a><figcaption class="wp-caption-text"> </figcaption></figure><br />
<span id="more-2919"></span></p>
<h3>2. Is it possible to extend an interface with an abstract class?</h3>
<ul>
<li>Yes <span style="color: #339966;">correct answer</span> (<a href="/2011/10/20/some-notes-on-the-object-oriented-model-of-php/" title="Some Notes on the Object-oriented Model of PHP">ref</a>)</li>
<li>No</li>
</ul>
<figure id="attachment_2926" style="width: 600px" class="wp-caption alignnone"><a href="/wp-content/uploads/2012/03/answer21.png"><img src="/wp-content/uploads/2012/03/answer21.png" alt="Answers of the second question" title="Answers of the second question" width="600" height="371" class="size-full wp-image-2926" srcset="/wp-content/uploads/2012/03/answer21.png 600w, /wp-content/uploads/2012/03/answer21-300x185.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></a><figcaption class="wp-caption-text"> </figcaption></figure>
<h3>3. What is the output of the following code?</h3>
<pre lang="PHP">$arr = array(1 => 10, "1" => 20); 
echo count($arr);</pre>
<ul>
<li>Error</li>
<li>0</li>
<li>1 <span style="color: #339966;">correct answer</span> (<a href="/2011/10/19/thing-to-know-about-php-arrays/" title="Thing to Know About PHP Arrays">ref</a>)</li>
<li>2</li>
</ul>
<figure id="attachment_2927" style="width: 600px" class="wp-caption alignnone"><a href="/wp-content/uploads/2012/03/answer31.png"><img src="/wp-content/uploads/2012/03/answer31.png" alt="Answers of the third question" title="Answers of the third question" width="600" height="371" class="size-full wp-image-2927" srcset="/wp-content/uploads/2012/03/answer31.png 600w, /wp-content/uploads/2012/03/answer31-300x185.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></a><figcaption class="wp-caption-text"> </figcaption></figure>
<h3>4. What is the output of the following code?</h3>
<pre lang="PHP">$str = "hello world"; echo $str{1};</pre>
<ul>
<li>An error</li>
<li>h</li>
<li>e <span style="color: #339966;">correct answer</span> (<a href="/2011/08/18/powerful-php-less-known-string-manipulation/" title="Powerful PHP: Less Known String Manipulation">ref</a>)</li>
<li>ello world</li>
</ul>
<figure id="attachment_2928" style="width: 600px" class="wp-caption alignnone"><a href="/wp-content/uploads/2012/03/answer41.png"><img src="/wp-content/uploads/2012/03/answer41.png" alt="Answers of the fourth question" title="Answers of the fourth question" width="600" height="371" class="size-full wp-image-2928" srcset="/wp-content/uploads/2012/03/answer41.png 600w, /wp-content/uploads/2012/03/answer41-300x185.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></a><figcaption class="wp-caption-text"> </figcaption></figure>
<h3>5. What is the output of the following code?</h3>
<pre lang="PHP">
$str = "foo Bar"; 
echo ucwords($str);
</pre>
<ul>
<li>Foo bar</li>
<li>Foo Bar <span style="color: #339966;">correct answer</span> (<a href="/2010/09/17/5-php-string-functions-you-need-to-know/" title="5 PHP String Functions You Need to Know">ref</a>)</li>
<li>FOO BAR</li>
<li>foo bar</li>
</ul>
<figure id="attachment_2924" style="width: 600px" class="wp-caption alignnone"><a href="/wp-content/uploads/2012/03/answer5.png"><img src="/wp-content/uploads/2012/03/answer5.png" alt="Answers of the fifth question" title="Answers of the fifth question" width="600" height="371" class="size-full wp-image-2924" srcset="/wp-content/uploads/2012/03/answer5.png 600w, /wp-content/uploads/2012/03/answer5-300x185.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></a><figcaption class="wp-caption-text"> </figcaption></figure>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2012/03/07/you-think-you-know-javascript-quiz-results/" rel="bookmark" title="You think you know javascript. Quiz results!">You think you know javascript. Quiz results! </a></li>
<li><a href="/2012/05/09/you-think-you-know-algorithms-quiz-results-2/" rel="bookmark" title="You think you know algorithms. Quiz results!">You think you know algorithms. Quiz results! </a></li>
<li><a href="/2012/02/29/you-think-you-know-algorithms-quiz-results/" rel="bookmark" title="You think you know algorithms. Quiz results!">You think you know algorithms. Quiz results! </a></li>
<li><a href="/2010/09/17/5-php-string-functions-you-need-to-know/" rel="bookmark" title="5 PHP String Functions You Need to Know">5 PHP String Functions You Need to Know </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2012/03/16/you-think-you-know-php-quiz-results/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Object Cloning and Passing by Reference in PHP</title>
		<link>/2011/10/27/object-cloning-and-passing-by-reference-in-php/</link>
		<comments>/2011/10/27/object-cloning-and-passing-by-reference-in-php/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 14:25:17 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Clone]]></category>
		<category><![CDATA[Cloning]]></category>
		<category><![CDATA[Comparison of programming languages]]></category>
		<category><![CDATA[Computer programming]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Curly bracket programming languages]]></category>
		<category><![CDATA[Java programming language]]></category>
		<category><![CDATA[PHP programming language]]></category>
		<category><![CDATA[Procedural programming languages]]></category>
		<category><![CDATA[Scripting languages]]></category>
		<category><![CDATA[Software engineering]]></category>

		<guid isPermaLink="false">/?p=2408</guid>
		<description><![CDATA[In PHP everything&#8217;s a reference! I&#8217;ve heard it so many times in my practice. No, these words are too strong! Let&#8217;s see some examples. Passing Parameters by Reference Clearly when we pass parameters to a function it&#8217;s not by reference. How to check this? Well, like this. function f($param) { $param++; } $a = 5; &#8230; <a href="/2011/10/27/object-cloning-and-passing-by-reference-in-php/" class="more-link">Continue reading <span class="screen-reader-text">Object Cloning and Passing by Reference in PHP</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2012/08/17/its-not-true-that-php-arrays-are-copied-by-value/" rel="bookmark" title="It&#8217;s Not True that PHP Arrays are Copied by Value">It&#8217;s Not True that PHP Arrays are Copied by Value </a></li>
<li><a href="/2012/04/26/php-strings-dont-need-quotes/" rel="bookmark" title="PHP Strings Don&#8217;t Need Quotes">PHP Strings Don&#8217;t Need Quotes </a></li>
<li><a href="/2011/10/20/some-notes-on-the-object-oriented-model-of-php/" rel="bookmark" title="Some Notes on the Object-oriented Model of PHP">Some Notes on the Object-oriented Model of PHP </a></li>
<li><a href="/2010/06/11/friday-algorithms-quicksort-difference-between-php-and-javascript/" rel="bookmark" title="Friday Algorithms: Quicksort &#8211; Difference Between PHP and JavaScript">Friday Algorithms: Quicksort &#8211; Difference Between PHP and JavaScript </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>In <a href="/category/php/" title="PHP at stoimen.com">PHP </a>everything&#8217;s a reference! I&#8217;ve heard it so many times in my practice. No, these words are too strong! Let&#8217;s see some examples.<br />
<figure id="attachment_2432" style="width: 480px" class="wp-caption alignnone"><a href="/wp-content/uploads/2011/10/ampersand.jpg"><img src="/wp-content/uploads/2011/10/ampersand.jpg" alt="Passing by reference in PHP can be tricky!" title="ampersand" width="480" height="480" class="size-full wp-image-2432" srcset="/wp-content/uploads/2011/10/ampersand.jpg 480w, /wp-content/uploads/2011/10/ampersand-150x150.jpg 150w, /wp-content/uploads/2011/10/ampersand-300x300.jpg 300w" sizes="(max-width: 480px) 100vw, 480px" /></a><figcaption class="wp-caption-text">Some developers think that everything&#039;s passed by reference in PHP.</figcaption></figure></p>
<h2>Passing Parameters by Reference</h2>
<p>Clearly when we pass parameters to a function it&#8217;s not by reference. How to check this? Well, like this.</p>
<pre lang="PHP">
function f($param)
{
	$param++;
}

$a = 5;
f($a);

echo $a;
</pre>
<p>Now the value of $a equals 5. If it were passed by reference, it would be 6. With a little change of the code we can get it.</p>
<pre lang="PHP">
function f(&$param)
{
	$param++;
}

$a = 5;
f($a);

echo $a;
</pre>
<p>Now the variable&#8217;s value is 6. </p>
<p>So far, so good. Now what about copying objects?<br />
<span id="more-2408"></span></p>
<h2>Objects: A Copy or a Cloning?</h2>
<p>We can check whether by assigning an object to a variable a reference or a copy of the object is passed.</p>
<pre lang="PHP">
class C
{
	public $myvar = 10;
}

$a = new C();
$b = $a;

$b->myvar = 20;

// 20, not 10
echo $a->myvar;
</pre>
<p>The last line outputs 20! This makes it clear. By assigning an object to a variable PHP pass its reference. To make a copy there&#8217;s another approach. We need to change $b = $a, to $b = clone $a;</p>
<pre lang="PHP" escaped="true">
class C
{
	public $myvar = 10;
}

$a = new C();
$b = clone $a;

$b->myvar = 20;

// 10
echo $a->myvar;
</pre>
<h2>Arrays by Reference</h2>
<p>What about arrays? What if I assign an array to a variable?</p>
<pre lang="PHP">
$a = array(20);

$b = $a;
$b[0] = 30;

var_dump($a);
</pre>
<p>What do you think is the value of $a[0]? Well, the answer is: 20! So $b is a copy of the array &#8220;a&#8221;. Instead you should assign explicitly its reference to make &#8220;b&#8221; point to &#8220;a&#8221;.</p>
<pre lang="PHP">
$a = array(20);

$b = &$a;
$b[0] = 30;

var_dump($a);
</pre>
<p>Now $a[0] equals 30!</p>
<p>I think this could be useful!</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2012/08/17/its-not-true-that-php-arrays-are-copied-by-value/" rel="bookmark" title="It&#8217;s Not True that PHP Arrays are Copied by Value">It&#8217;s Not True that PHP Arrays are Copied by Value </a></li>
<li><a href="/2012/04/26/php-strings-dont-need-quotes/" rel="bookmark" title="PHP Strings Don&#8217;t Need Quotes">PHP Strings Don&#8217;t Need Quotes </a></li>
<li><a href="/2011/10/20/some-notes-on-the-object-oriented-model-of-php/" rel="bookmark" title="Some Notes on the Object-oriented Model of PHP">Some Notes on the Object-oriented Model of PHP </a></li>
<li><a href="/2010/06/11/friday-algorithms-quicksort-difference-between-php-and-javascript/" rel="bookmark" title="Friday Algorithms: Quicksort &#8211; Difference Between PHP and JavaScript">Friday Algorithms: Quicksort &#8211; Difference Between PHP and JavaScript </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2011/10/27/object-cloning-and-passing-by-reference-in-php/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Some Notes on the Object-oriented Model of PHP</title>
		<link>/2011/10/20/some-notes-on-the-object-oriented-model-of-php/</link>
		<comments>/2011/10/20/some-notes-on-the-object-oriented-model-of-php/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 15:08:15 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[abstract classes]]></category>
		<category><![CDATA[Abstract type]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Class]]></category>
		<category><![CDATA[Computer programming]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Education]]></category>
		<category><![CDATA[experiment]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[iheritance]]></category>
		<category><![CDATA[Interfaces]]></category>
		<category><![CDATA[Java programming language]]></category>
		<category><![CDATA[Method]]></category>
		<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[Object-oriented programming]]></category>
		<category><![CDATA[php 5]]></category>
		<category><![CDATA[php class definition]]></category>
		<category><![CDATA[php experiment]]></category>
		<category><![CDATA[php tutorial]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[Polymorphism in object-oriented programming]]></category>
		<category><![CDATA[Software design patterns]]></category>
		<category><![CDATA[Software engineering]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[Virtual function]]></category>

		<guid isPermaLink="false">/?p=2401</guid>
		<description><![CDATA[PHP 5 introduces interfaces and abstract classes. To become a little clearer, let us see their definitions. Interfaces Object interfaces allow you to create code which specifies which methods a class must implement, without having to define how these methods are handled. Interfaces are defined using the interface keyword, in the same way as a &#8230; <a href="/2011/10/20/some-notes-on-the-object-oriented-model-of-php/" class="more-link">Continue reading <span class="screen-reader-text">Some Notes on the Object-oriented Model of PHP</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2011/05/30/object-oriented-javascript-inheritance/" rel="bookmark" title="Object Oriented JavaScript: Inheritance">Object Oriented JavaScript: Inheritance </a></li>
<li><a href="/2011/07/28/oop-javascript-accessing-public-methods-in-private-methods/" rel="bookmark" title="OOP JavaScript: Accessing Public Methods in Private Methods">OOP JavaScript: Accessing Public Methods in Private Methods </a></li>
<li><a href="/2011/10/27/object-cloning-and-passing-by-reference-in-php/" rel="bookmark" title="Object Cloning and Passing by Reference in PHP">Object Cloning and Passing by Reference in PHP </a></li>
<li><a href="/2011/11/14/php-dont-call-the-destructor-explicitly/" rel="bookmark" title="PHP: Don&#8217;t Call the Destructor Explicitly">PHP: Don&#8217;t Call the Destructor Explicitly </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>PHP 5 introduces interfaces and abstract classes. To become a little clearer, let us see their definitions.</p>
<h2>Interfaces</h2>
<blockquote><p>Object interfaces allow you to create code which specifies which methods a class must implement, without having to define how these methods are handled.<br />
Interfaces are defined using the interface keyword, in the same way as a standard class, but without any of the methods having their contents defined.<br />
All methods declared in an interface must be public, this is the nature of an interface. </p>
<p>To implement an interface, the implements operator is used. All methods in the interface must be implemented within a class; failure to do so will result in a fatal error. Classes may implement more than one interface if desired by separating each interface with a comma. </p></blockquote>
<h2>Abstract Classes</h2>
<blockquote><p>PHP 5 introduces abstract classes and methods. Classes defined as abstract may not be instantiated, and any class that contains at least one abstract method must also be abstract. Methods defined as abstract simply declare the method&#8217;s signature &#8211; they cannot define the implementation.</p>
<p>When inheriting from an abstract class, all methods marked abstract in the parent&#8217;s class declaration must be defined by the child; additionally, these methods must be defined with the same (or a less restricted) visibility. For example, if the abstract method is defined as protected, the function implementation must be defined as either protected or public, but not private. Furthermore the signatures of the methods must match, i.e. the type hints and the number of required arguments must be the same. This also applies to constructors as of PHP 5.4. Before 5.4 constructor signatures could differ. </p></blockquote>
<h2>Some Cases</h2>
<p>Now let&#8217;s do a quick experiment. According to the definition of interfaces we can define an interface and than an abstract class can implement this interface.<br />
<span id="more-2401"></span></p>
<pre lang="PHP">
interface A
{
	public function a();
}

abstract class B implements A
{
	public function a()
	{
		return 10;
	}
}
</pre>
<p>However the abstract class cannot be instantiated so we need to extend it.</p>
<pre lang="PHP">
interface A
{
	public function a();
}

abstract class B implements A
{
	public function a()
	{
		return 10;
	}
}

class C extends B
{
	...
}
</pre>
<p>In the first place is completely OK to define an abstract class that does not contain any abstract method. TUsually if a class has one or more abstract methods <em>(Methods defined as abstract simply declare the method&#8217;s signature &#8211; they cannot define the implementation, according to the docs)</em>, it must be defined as abstract. But we can also define an abstract class which has no abstract methods.</p>
<pre lang="PHP">
abstract class B
{
	public function a()
	{
		return 5;
	}
}

class C extends B
{
	public function a()
	{
		return 10;
	}
}

$c = new C();
echo $c->a();
</pre>
<p>OK then what would happen if we had an interface that is implemented by an abstract class, which in turn is extended by a given class. First of all if a class implements an interface, even if it is an abstract class, it must implement all methods defined in the interface. So if the predefined method in the abstract class is marked as abstract, it would result into a fatal error.</p>
<pre lang="PHP">
interface A
{
	public function a();
}

abstract class B implements A
{
	abstract public function a();
}

class C extends B
{
	public function a()
	{
		return 5;
	}
}

$c = new C();
echo $c->a();
</pre>
<p>This is perfectly logical, because in fact each method of the interface must be implemented by his children.</p>
<p><em>&#8220;All methods in the interface must be implemented within a class; failure to do so will result in a fatal error.&#8221;<br />
</em><br />
Fine, but we can have abstract classes with no abstract methods, let&#8217;s try this:</p>
<pre lang="PHP">
interface A
{
	public function a();
}

abstract class B implements A
{
	public function a()
	{
		return 10;
	}
}

class C extends B
{
	public function a()
	{
		return 5;
	}
}

$c = new C();
echo $c->a();
</pre>
<p>This code is working and the result is the returned value from C::a(). However class B is abstract so let&#8217;s go even further. Let&#8217;s define an abstract method, different from the method B::a().</p>
<pre lang="PHP">
interface A
{
	public function a();
}

abstract class B implements A
{
	public function a()
	{
		return 10;
	}
	
	abstract public function b();
}

class C extends B
{
	public function a()
	{
		return 5;
	}
	
	public function b()
	{
		return "hello world!";
	}
}

$c = new C();
echo $c->a();
echo $c->b();
</pre>
<p>Now there&#8217;s a fatal error. Why?</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2011/05/30/object-oriented-javascript-inheritance/" rel="bookmark" title="Object Oriented JavaScript: Inheritance">Object Oriented JavaScript: Inheritance </a></li>
<li><a href="/2011/07/28/oop-javascript-accessing-public-methods-in-private-methods/" rel="bookmark" title="OOP JavaScript: Accessing Public Methods in Private Methods">OOP JavaScript: Accessing Public Methods in Private Methods </a></li>
<li><a href="/2011/10/27/object-cloning-and-passing-by-reference-in-php/" rel="bookmark" title="Object Cloning and Passing by Reference in PHP">Object Cloning and Passing by Reference in PHP </a></li>
<li><a href="/2011/11/14/php-dont-call-the-destructor-explicitly/" rel="bookmark" title="PHP: Don&#8217;t Call the Destructor Explicitly">PHP: Don&#8217;t Call the Destructor Explicitly </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2011/10/20/some-notes-on-the-object-oriented-model-of-php/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Powerful PHP: Less Known String Manipulation</title>
		<link>/2011/08/18/powerful-php-less-known-string-manipulation/</link>
		<comments>/2011/08/18/powerful-php-less-known-string-manipulation/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 14:01:51 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Computer programming]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Data types]]></category>
		<category><![CDATA[Hello world program]]></category>
		<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[Software engineering]]></category>
		<category><![CDATA[String]]></category>

		<guid isPermaLink="false">/?p=2343</guid>
		<description><![CDATA[Yet another thing that&#8217;s great in PHP is the power you have when doing some string manipulation/operation. Here&#8217;s something that is really useful, but I think it remains a bit unknown. Let&#8217;s imagine you need to take the first (or whatever) character of a string. Most developers go to the obvious: $str = 'hello world'; &#8230; <a href="/2011/08/18/powerful-php-less-known-string-manipulation/" class="more-link">Continue reading <span class="screen-reader-text">Powerful PHP: Less Known String Manipulation</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2010/08/27/php-what-is-more-powerful-than-list/" rel="bookmark" title="PHP: What is More Powerful Than list()">PHP: What is More Powerful Than list() </a></li>
<li><a href="/2011/07/12/a-javascript-trick-you-should-know/" rel="bookmark" title="A JavaScript Trick You Should Know">A JavaScript Trick You Should Know </a></li>
<li><a href="/2010/09/17/5-php-string-functions-you-need-to-know/" rel="bookmark" title="5 PHP String Functions You Need to Know">5 PHP String Functions You Need to Know </a></li>
<li><a href="/2010/08/31/php-what-is-more-powerful-than-list-perhaps-extract/" rel="bookmark" title="PHP: What is More Powerful Than list() &#8211; Perhaps extract()">PHP: What is More Powerful Than list() &#8211; Perhaps extract() </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Yet another thing that&#8217;s great in PHP is the power you have when doing some string manipulation/operation. Here&#8217;s something that is really useful, but I think it remains a bit unknown. Let&#8217;s imagine you need to take the first (or whatever) character of a string. Most developers go to the obvious:</p>
<pre lang="PHP">
$str = 'hello world';
echo substr($str, 0, 1); // outputs "h"
</pre>
<p>But here&#8217;s something better and cleaner.</p>
<pre lang="PHP">
echo $str{0}; // outputs "h"
</pre>
<p>This code chunk return the first character of $str, but it can be used with the same success for any other character of the string. In my opinion this is more cleaner and its really syntactically self documented.</p>
<p>This approach can be useful when trying to check whether the first symbol for instance is &#8220;?&#8221; or &#8220;/&#8221;.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2010/08/27/php-what-is-more-powerful-than-list/" rel="bookmark" title="PHP: What is More Powerful Than list()">PHP: What is More Powerful Than list() </a></li>
<li><a href="/2011/07/12/a-javascript-trick-you-should-know/" rel="bookmark" title="A JavaScript Trick You Should Know">A JavaScript Trick You Should Know </a></li>
<li><a href="/2010/09/17/5-php-string-functions-you-need-to-know/" rel="bookmark" title="5 PHP String Functions You Need to Know">5 PHP String Functions You Need to Know </a></li>
<li><a href="/2010/08/31/php-what-is-more-powerful-than-list-perhaps-extract/" rel="bookmark" title="PHP: What is More Powerful Than list() &#8211; Perhaps extract()">PHP: What is More Powerful Than list() &#8211; Perhaps extract() </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2011/08/18/powerful-php-less-known-string-manipulation/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>OOP JavaScript: Accessing Public Methods in Private Methods</title>
		<link>/2011/07/28/oop-javascript-accessing-public-methods-in-private-methods/</link>
		<comments>/2011/07/28/oop-javascript-accessing-public-methods-in-private-methods/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 12:05:42 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[Accessing Private]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Class]]></category>
		<category><![CDATA[Computer programming]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Curly bracket programming languages]]></category>
		<category><![CDATA[JavaScript programming language]]></category>
		<category><![CDATA[Object-oriented programming]]></category>
		<category><![CDATA[oop]]></category>
		<category><![CDATA[private]]></category>
		<category><![CDATA[public]]></category>
		<category><![CDATA[Scripting languages]]></category>
		<category><![CDATA[Software engineering]]></category>
		<category><![CDATA[Subroutine]]></category>

		<guid isPermaLink="false">/?p=2339</guid>
		<description><![CDATA[As you know in JavaScript when you define a variable with the special word &#8220;var&#8221; the scope of this variable is within the function. So when you simply wite &#8220;var a = 5&#8221; the variable named &#8220;a&#8221; has a global scope and can be accessed in any function in the global scope. var a = &#8230; <a href="/2011/07/28/oop-javascript-accessing-public-methods-in-private-methods/" class="more-link">Continue reading <span class="screen-reader-text">OOP JavaScript: Accessing Public Methods in Private Methods</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2011/05/30/object-oriented-javascript-inheritance/" rel="bookmark" title="Object Oriented JavaScript: Inheritance">Object Oriented JavaScript: Inheritance </a></li>
<li><a href="/2011/10/20/some-notes-on-the-object-oriented-model-of-php/" rel="bookmark" title="Some Notes on the Object-oriented Model of PHP">Some Notes on the Object-oriented Model of PHP </a></li>
<li><a href="/2010/08/11/quick-look-at-javascript-objects/" rel="bookmark" title="Quick Look at JavaScript Objects">Quick Look at JavaScript Objects </a></li>
<li><a href="/2010/03/09/what-make-javascript-closures-work/" rel="bookmark" title="What make JavaScript closures work?">What make JavaScript closures work? </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>As you know in JavaScript when you define a variable with the special word &#8220;var&#8221; the scope of this variable is within the function. So when you simply wite &#8220;var a = 5&#8221; the variable named &#8220;a&#8221; has a global scope and can be accessed in any function in the global scope. </p>
<pre lang="javascript">
var a = 5;

function f() { return a; } // returns 5
</pre>
<p>Thus f will return the value of &#8220;a&#8221; which equals to 5. You can also change the value of the global variable in the function body.</p>
<pre lang="javascript">
var a = 5;
function f() { a = 10; return a; }
console.log(a); // equals to 10
</pre>
<p>Now after we call the function f the value of &#8220;a&#8221; will equal to 10. This is because we reference the global variable &#8220;a&#8221; into the function body without using the keyword &#8220;var&#8221;. This means that if you put the &#8220;var&#8221; keyword the variable &#8220;a&#8221; inside the function body is no longer the same variable as the variable defined outside the body. It becames &#8220;local&#8221; and it&#8217;s visible only inside the function.<br />
<span id="more-2339"></span></p>
<h2>Objects &#038; JavaScript</h2>
<p>Actually in JavaScript functions can be also objects. Any variable defined with the &#8220;var&#8221; keyword becomes private, because it&#8217;s only visible inside the function body, while by using the &#8220;this&#8221; keyword we can define global variables visible outside the function body. Let&#8217;s see na example.</p>
<pre lang="javascript">
var f = function() 
{
	var a = 10;
	this.b = 5;
}

var myfunc = new f();
myfunc.a; // is undefined because a is private
myfunc.b; // equals to 5 because b is public
</pre>
<h2>Public and Private Methods in JavaScript</h2>
<p>As you may know in JS you can define functions inside other functions. Actually this is how you can define classes in JavaScript.</p>
<pre lang="javascript">
var myClass = function() 
{
	var f = function() {
		return 10;
	}
}
</pre>
<p>But this in fact defines a local (private) function into myClass and we cannot access it from the outside world. Here&#8217;s a fully functional class with one public and one private method.</p>
<pre lang="javascript">
var myClass = function()
{
	// public method
	this.a = function() {
		return 10;
	}
	
	// private method
	var b = function() {
		return 5;
	}
}

var c = new myClass();
c.a(); // will return 10
c.b(); // is undefined, because is private
</pre>
<h2>Accessing Private Methods from Public Methods</h2>
<p>Easily we can access private methods from public ones.</p>
<pre lang="javascript">
var myClass = function()
{
	// public method
	this.a = function() {
		return b();
	}
	
	// private method
	var b = function() {
		return 5;
	}
}
</pre>
<p>However accessing public mtehods in private ones is more difficult. That&#8217;s because we cannot use &#8220;this&#8221; into the private methods, just because &#8220;this&#8221; refers to the private method<br />
itself and not to the global method, which is &#8220;myClass&#8221; in our case.</p>
<pre lang="javascript">
var myClass = function()
{
	// public method
	this.a = function() {
		return 10;
	}
	
	// private method
	var b = function() {
		return this.a(); // this will result in an error
	}
}
</pre>
<h2>Accessing Public Methods from Private Methods</h2>
<p>To access public methods in private methods you need to define a variable that points to the global &#8220;this&#8221; object.</p>
<pre lang="javascript">
var myClass = function()
{
	var self = this; 
	
	// public method
	this.a = function() {
		return 10;
	}
	
	// private method
	var b = function() {
		return self.a(); // this will return 10
	}
}
</pre>
<p>This variable gives you the bridge between private methods and global &#8220;this&#8221; pointer.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2011/05/30/object-oriented-javascript-inheritance/" rel="bookmark" title="Object Oriented JavaScript: Inheritance">Object Oriented JavaScript: Inheritance </a></li>
<li><a href="/2011/10/20/some-notes-on-the-object-oriented-model-of-php/" rel="bookmark" title="Some Notes on the Object-oriented Model of PHP">Some Notes on the Object-oriented Model of PHP </a></li>
<li><a href="/2010/08/11/quick-look-at-javascript-objects/" rel="bookmark" title="Quick Look at JavaScript Objects">Quick Look at JavaScript Objects </a></li>
<li><a href="/2010/03/09/what-make-javascript-closures-work/" rel="bookmark" title="What make JavaScript closures work?">What make JavaScript closures work? </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2011/07/28/oop-javascript-accessing-public-methods-in-private-methods/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>JavaScript Objects Coding Style Reviewed</title>
		<link>/2010/12/03/javascript-objects-coding-style-reviewed/</link>
		<comments>/2010/12/03/javascript-objects-coding-style-reviewed/#comments</comments>
		<pubDate>Fri, 03 Dec 2010 10:05:59 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Computer programming]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Curly bracket programming languages]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming style]]></category>
		<category><![CDATA[Software engineering]]></category>
		<category><![CDATA[Where]]></category>

		<guid isPermaLink="false">/?p=2084</guid>
		<description><![CDATA[JS Objects Once I posted about JavaScript object coding style. Back than I made the analogy with PHP array coding style. In breve it&#8217;s useful to format the arrays in PHP simply like that: $data = array( 'key1' =&#62; 'value1', 'key2' =&#62; 'value2', 'key3' =&#62; 'value3', 'key4' =&#62; 'value4', 'key5' =&#62; 'value5', ); Note that &#8230; <a href="/2010/12/03/javascript-objects-coding-style-reviewed/" class="more-link">Continue reading <span class="screen-reader-text">JavaScript Objects Coding Style Reviewed</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2010/05/19/php-associative-arrays-coding-style/" rel="bookmark" title="PHP Associative Arrays Coding Style">PHP Associative Arrays Coding Style </a></li>
<li><a href="/2010/05/24/javascript-objects-coding-style/" rel="bookmark" title="JavaScript Objects Coding Style">JavaScript Objects Coding Style </a></li>
<li><a href="/2010/05/26/php-conditionals-coding-style/" rel="bookmark" title="PHP: Conditionals Coding Style">PHP: Conditionals Coding Style </a></li>
<li><a href="/2011/05/30/object-oriented-javascript-inheritance/" rel="bookmark" title="Object Oriented JavaScript: Inheritance">Object Oriented JavaScript: Inheritance </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>JS Objects</h2>
<p>Once I posted about <a title="JavaScript Objects Coding style" href="/2010/05/24/javascript-objects-coding-style/" target="_blank">JavaScript object coding style</a>. Back than I made the analogy with PHP array coding style. In breve it&#8217;s useful to format the arrays in PHP simply like that:</p>
<pre lang="php" escaped="true">$data = array(
	'key1' =&gt; 'value1',
	'key2' =&gt; 'value2',
	'key3' =&gt; 'value3',
	'key4' =&gt; 'value4',
	'key5' =&gt; 'value5',
);
</pre>
<p>Note that there is a trailing comma after the last key/value pair. This is not a syntax error and helps you add new elements to the array with no fear to forget the comma. This coding standard is quite well known in the PHP community, but in fact writing JavaScript objects can be &#8220;translated&#8221; to something very similar. The only problem is that the trailing comma in JavaScript will result to an error, especially in Internet Explorer, so it is important to remove it.</p>
<pre lang="javascript">
var obj = {
	key1 : 'value1',
	key2 : 'value2',
	key3 : 'value3',
	key4 : 'value4',
	key5 : 'value5'
};
</pre>
<p>The problem is that when you&#8217;ve to add one key/value pair, you&#8217;ve to add the comma after the last pair. This actually makes it useless.</p>
<h2>Better Solution</h2>
<p>There is another way, much better I think, that may help you more when adding new pairs to the object.</p>
<pre lang="javascript">
var obj = 
	{ key1 : 'value1'
	, key2 : 'value2'
	, key3 : 'value3'
	, key4 : 'value4'
	, key5 : 'value5'
	};
</pre>
<p>In this example you can simply copy/paste the last pair and change the key and value, or you can simply can continue writing the way the object is constructed.</p>
<p>Thus you don&#8217;t have the problem with the last comma and syntax errors.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2010/05/19/php-associative-arrays-coding-style/" rel="bookmark" title="PHP Associative Arrays Coding Style">PHP Associative Arrays Coding Style </a></li>
<li><a href="/2010/05/24/javascript-objects-coding-style/" rel="bookmark" title="JavaScript Objects Coding Style">JavaScript Objects Coding Style </a></li>
<li><a href="/2010/05/26/php-conditionals-coding-style/" rel="bookmark" title="PHP: Conditionals Coding Style">PHP: Conditionals Coding Style </a></li>
<li><a href="/2011/05/30/object-oriented-javascript-inheritance/" rel="bookmark" title="Object Oriented JavaScript: Inheritance">Object Oriented JavaScript: Inheritance </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2010/12/03/javascript-objects-coding-style-reviewed/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Diving into Node.js &#8211; Introduction &#038; Installation</title>
		<link>/2010/11/16/diving-into-node-js-introduction-and-installation/</link>
		<comments>/2010/11/16/diving-into-node-js-introduction-and-installation/#comments</comments>
		<pubDate>Tue, 16 Nov 2010 08:17:32 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[Apache Corporation]]></category>
		<category><![CDATA[Apache HTTP Server]]></category>
		<category><![CDATA[application/server]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[classical chat server]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Google Chrome]]></category>
		<category><![CDATA[Google Inc.]]></category>
		<category><![CDATA[Inter-process communication]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[JavaScript programming language]]></category>
		<category><![CDATA[Node.js]]></category>
		<category><![CDATA[normal server]]></category>
		<category><![CDATA[normal web server]]></category>
		<category><![CDATA[operating system]]></category>
		<category><![CDATA[Push technology]]></category>
		<category><![CDATA[Server-side JavaScript]]></category>
		<category><![CDATA[Software engineering]]></category>
		<category><![CDATA[Technology/Internet]]></category>
		<category><![CDATA[typical web server]]></category>
		<category><![CDATA[Web browser]]></category>
		<category><![CDATA[web developer team]]></category>
		<category><![CDATA[web server]]></category>
		<category><![CDATA[web server example]]></category>
		<category><![CDATA[web serving functionality]]></category>
		<category><![CDATA[World Wide Web]]></category>

		<guid isPermaLink="false">/?p=2037</guid>
		<description><![CDATA[Why I Need Something Like Node.js? First of all the use of some software is needed not because of itself, but because of the need of some specific functionality. In my case this was the need of real time news feed. Of course there is a way to make this without Node.js, as I&#8217;ll describe &#8230; <a href="/2010/11/16/diving-into-node-js-introduction-and-installation/" class="more-link">Continue reading <span class="screen-reader-text">Diving into Node.js &#8211; Introduction &#038; Installation</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2010/12/02/diving-into-node-js-a-long-polling-example/" rel="bookmark" title="Diving into Node.js &#8211; A Long Polling Example">Diving into Node.js &#8211; A Long Polling Example </a></li>
<li><a href="/2010/11/19/diving-into-node-js-very-first-app/" rel="bookmark" title="Diving into Node.js &#8211; Very First App">Diving into Node.js &#8211; Very First App </a></li>
<li><a href="/2010/01/31/speed-up-the-javascript-it-can-change-dramatically-the-user-experience/" rel="bookmark" title="Speed up the JavaScript. It can change dramatically the user experience.">Speed up the JavaScript. It can change dramatically the user experience. </a></li>
<li><a href="/2010/01/11/what-should-be-optimized-in-one-web-page/" rel="bookmark" title="What should be optimized in one web page?">What should be optimized in one web page? </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>Why I Need Something Like Node.js?</h2>
<p>First of all the use of some software is needed not because of itself, but because of the need of some specific functionality. In my case this was the need of real time news feed. Of course there is a way to make this without <a title="Node.js" href="http://nodejs.org/" target="_blank">Node.js</a>, as I&#8217;ll describe later in this post, but there are several disadvantages. However to begin from somewhere, let me explain what is Node.js.</p>
<h2>Introducing Node.js</h2>
<p>Perhaps the best way do describe what is Node.js is from its <a title="Node.js" href="http://nodejs.org/#about" target="_blank">about page</a>.</p>
<blockquote><p>Node&#8217;s goal is to provide an easy way to build scalable network programs. In the &#8220;hello world&#8221; web server example above, many client connections can be handled concurrently. Node tells the operating system (through epoll, kqueue, /dev/poll, or select) that it should be notified when a new connection is made, and then it goes to sleep. If someone new connects, then it executes the callback. Each connection is only a small heap allocation.</p>
<p>&#8230;</p></blockquote>
<p>In general Node is a program using the Google Chrome&#8217;s <a title="V8 JavaScript engine" href="http://code.google.com/p/v8/" target="_blank">V8 JavaScript</a> engine, which in turn is a program that can parse and execute code written in JavaScript. V8 is a very very interesting project itself. First of all from Google have developed this engine especially for one of his products &#8211; their browser <a title="Google Chrome" href="http://www.google.com/chrome" target="_blank">Chrome</a>. It pretends to be and by no means is one of the masterpieces of Google. It is fast and reliable engine, written in C++ and JavaScript, as <a title="V8 JavaScript engine on Wikipedia" href="http://en.wikipedia.org/wiki/V8_%28JavaScript_engine%29" target="_blank">Wikipedia&#8217;s page</a> says. Actually this code is open source and can be embedded in whatever application written in C++. Thus you can have in your application a JavaScript engine.<span id="more-2037"></span></p>
<p>Such kind of application/server is Node.js. With V8 embedded into, Node is intended to run on a machine and to serve some requests. Just like a normal web server, but with few differences. First of all Node is not only serving HTTP requests, but also TCP. Well I&#8217;m not so deep into this yet, but so far that works for me. What I need for now is its web serving functionality.</p>
<p>The way Node works, however is different from what we know from every other web server. Here it is a normal server in general:</p>
<p><a href="/wp-content/uploads/2010/11/client-server.png"></a><a href="/wp-content/uploads/2010/11/client-server.png"><img class="alignleft size-full wp-image-2053" title="client-server" src="/wp-content/uploads/2010/11/client-server.png" alt="Client Server" width="600" height="150" srcset="/wp-content/uploads/2010/11/client-server.png 600w, /wp-content/uploads/2010/11/client-server-300x75.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></a></p>
<p>Whenever a request comes to the server, it tries to return the response as fast as possible. This is one of the main goals of every web developer team &#8211; to make the application as fast as possible. However in Node the things work different:</p>
<p><a href="/wp-content/uploads/2010/11/node-client-server.png"><img class="alignleft size-full wp-image-2058" title="node-client-server" src="/wp-content/uploads/2010/11/node-client-server.png" alt="Node.js Client Server Application" width="600" height="150" srcset="/wp-content/uploads/2010/11/node-client-server.png 600w, /wp-content/uploads/2010/11/node-client-server-300x75.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></a></p>
<p>Here the server doesn&#8217;t return immediately the response, but holds as long as possible until some &#8220;event&#8221; occurs. You can thing of Node as a classical chat server. Until one of the peers doesn&#8217;t write a message, the other doesn&#8217;t receive anything.</p>
<blockquote><p>Some may be confused as how you can use both the typical web server, as Apache, with Node as another web server within the same page. The answer is &#8211; with AJAX. As you know thus you can have only one chunk of your page talking with the server &#8211; in this case the entire page is returned by Apache, but inside the page you can have a chat app using Node as a server, working perhaps on a different port on the same machine.</p></blockquote>
<p>Typically this scenario can be simulated without Node, but as I said, with some disadvantages. Let&#8217;s say you have two browsers and one server &#8211; you can infinitely loop AJAX calls to the server and whenever there is new message on the server return it to the browser &#8211; this is quite inefficient. There are two approaches in this case.</p>
<ol>
<li>You can make those AJAX calls too recently and you can have a call every N seconds. In that case if N is to short you&#8217;ll have too many calls and in case the other peer doesn&#8217;t make anything the server will be unusually loaded with no practical effect.</li>
<li>In the second case you can choose to make N too long &#8211; for instance 20 seconds. This is also bad, because during this period of time the peers may want to interact and chat.</li>
</ol>
<p>In that case Node is a web server, but simply doesn&#8217;t return the response until a specific event doesn&#8217;t occur. How does this look like in a web browser. You may know how looking into the <a title="Firebug" href="https://addons.mozilla.org/en-US/firefox/addon/1843/" target="_blank">Firebug console</a> for every AJAX call you see the request and how many seconds it has taken. If you make an AJAX call to a Node server app the request just doesn&#8217;t respond immediately.</p>
<h2>Installing Node.js</h2>
<p>The process of installation is <a title="Node.js Build" href="http://nodejs.org/#build" target="_blank">described quite well</a>, so I&#8217;m going to describe it in few steps.</p>
<ol>
<li>Download the application from Git, note that V8 is embedded inside. The version while this post was written and of course was stable is <a title="Node.js v0.2.4" href="http://nodejs.org/dist/node-v0.2.4.tar.gz" target="_blank">v0.2.4</a></li>
<li>For those familiar with Unix/Linux systems, there are three simple steps following, however without <a title="Gnu Compiler Collection" href="http://gcc.gnu.org/" target="_blank">GCC (Gnu Compiler Collection)</a> you wont be able to proceed! I&#8217;m writing this especially for the Mac OS users, as they may know there is no built-in GCC there.</li>
<li>./configure</li>
<li>make</li>
<li>make install</li>
<li>make test (optional)</li>
</ol>
<p>This in general is enough. After all that you can write the node command in your terminal. However if there are some problems while compiling it you may refer to Git and the Node community for more help. Don&#8217;t forget that V8 can work only on x86, x64 and ARM architectures.</p>
<h2>Summary</h2>
<p>There are few things that can be summarized now:</p>
<ol>
<li>First of all Node can be a web server, as Apache is, but with the option to respond on event firing.</li>
<li>You can request it either with a web page loaded in your browser or within a chunk of the page via AJAX.</li>
<li>To install Node you need GCC. It comes with V8 JavaScript engine inside, which can run only on x86, x64 and ARM.</li>
</ol>
<p>So far so good! Now we have Node installed, practically useless, because there is no application running on it. In my next post I&#8217;ll describe how to run your first application.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2010/12/02/diving-into-node-js-a-long-polling-example/" rel="bookmark" title="Diving into Node.js &#8211; A Long Polling Example">Diving into Node.js &#8211; A Long Polling Example </a></li>
<li><a href="/2010/11/19/diving-into-node-js-very-first-app/" rel="bookmark" title="Diving into Node.js &#8211; Very First App">Diving into Node.js &#8211; Very First App </a></li>
<li><a href="/2010/01/31/speed-up-the-javascript-it-can-change-dramatically-the-user-experience/" rel="bookmark" title="Speed up the JavaScript. It can change dramatically the user experience.">Speed up the JavaScript. It can change dramatically the user experience. </a></li>
<li><a href="/2010/01/11/what-should-be-optimized-in-one-web-page/" rel="bookmark" title="What should be optimized in one web page?">What should be optimized in one web page? </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2010/11/16/diving-into-node-js-introduction-and-installation/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
