unset in php


unset() does just what it’s name says – unset a variable. It does not force immediate memory freeing. PHP’s garbage collector will do it when it see fits – by intention as soon, as those CPU cycles aren’t needed anyway, or as late as before the script would run out of memory, whatever occurs first.…

Configure Xdebug with netbeans and PHP


Xdebug’s Profiler is a powerful tool that gives you the ability to analyze your PHP code and determine bottlenecks or generally see which parts of your code are slow and could use a speed boost. Here are the following steps for you to installing and configuring xdebug with netbeans Install the Firefox plugin by given URL:    …

Facts about Memcached


Q. Does memcache overwrite stored values if it runs out of memory, even if the item has not yet expired? Ans : If Memcached runs out of RAM, it will discard the oldest values.    

List all keys of Memcache


$host = “127.0.0.1”; $port = 11211; $lookupKey = “”; $limit = 10000; $time = time(); foreach ($argv as $key => $arg) { switch ($arg) { case ‘-h’: $host = $argv[$key + 1]; break; case ‘-p’: $port = $argv[$key + 1]; break; case ‘-s’: $lookupKey = $argv[$key + 1]; break; case ‘-l’: $limit = $argv[$key +…

What is Memcache?


Memcache is basically is a generalpurpose distributed memory caching system. it allows you to store any form of data in a ‘temporary cache’ so wherever you go to do a database query, instead of just connecting to the database and getting the data we want we first check the memcache to see if our data…

0 == ” (zero is equal to ”)


Recently I faced one issue where I noticed that zero is being equal to empty string and my condition was being true. $a = 0; if($a == ”){ echo ‘Condition true’; }else{ echo ‘Condition false’; }