Tag Archives: Computer programming

JavaScript Performance: for vs. while

JavaScript Loops If you have read some preformance tests on JavaScript loops, you may have heard that “while” is faster than “for”. However the question is how faster is “while”? Here are some results, but first let’s take a look … Continue reading

Posted in javascript | Tagged , , , , , , , , , , | 3 Comments

Object Cloning and Passing by Reference in PHP

In PHP everything’s a reference! I’ve heard it so many times in my practice. No, these words are too strong! Let’s see some examples. Passing Parameters by Reference Clearly when we pass parameters to a function it’s not by reference. … Continue reading

Posted in micro tutorial, PHP | Tagged , , , , , , , , , , , , | 3 Comments

Does JavaScript undefined Equals undefined?

Weird JS As you know sometimes JavaScript can be weird. Let’s see the following example and let’s try to answer the question: does “undefined” equals “undefined”. What do I mean? First take a look at the following code. var a; … Continue reading

Posted in javascript | Tagged , , , , , , , , , , , , , | 6 Comments

Some Notes on the Object-oriented Model of PHP

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 … Continue reading

Posted in PHP | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , | 5 Comments

Thing to Know About PHP Arrays

Consider the following case. We have an array with identical keys. $arr = array(1 => 10, 1 => 11); What happens when the interpreter reaches this line of code? This is not a syntax error and it is completely valid. … Continue reading

Posted in micro tutorial, PHP | Tagged , , , , , , , , , , , , , , , , , , | Leave a comment