Kishore Thota
Kishore Thota

Reputation: 87

var_dump not printing the integer values

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

Upvotes: 0

Views: 493

Answers (2)

james
james

Reputation: 3583

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)

Upvotes: 0

damianb
damianb

Reputation: 1224

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.

Upvotes: 1

Related Questions