0

I am trying to read some values from the membase. I observer that when there is any integer the following command is not working.

 var_dump($memcache->get("keyset123"));
 print_r($memcache->get("keyset123"));

If the get result is a string the above command prints. If the get result is a Integer the above commands are printing none.

vardump prints =string(0) "" print_r prints none.

can you please tell me what is the issue

Jim
  • 18,673
  • 5
  • 49
  • 65
Kishore Thota
  • 87
  • 1
  • 6

2 Answers2

1

That is because the $memcache->get() call is returning a string value. Your problem lies elsewhere (likely deeper within the code in use), not within var_dump().

Look into what you're storing within whatever is inside of the variable $memcache.

damianb
  • 1,224
  • 7
  • 16
0
var_dump($memcache->get("keyset123"));
//outputs
//string(0) ""

Memcached is storing an empty string at the key "keyset123", otherwise you would be getting FALSE (key doesn't exist) or NULL (key exists, but no value exists)

james
  • 3,543
  • 8
  • 31
  • 39
  • James, keyset123 is having a integer value in the database. why am I not able to get that value? If I keep the value as string it works – Kishore Thota Jun 04 '11 at 03:46