Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #3647

Re: integer and string what's the difference ?

From Balazs Nadasdi <yitsushi@gmail.com>
Newsgroups comp.lang.php
Subject Re: integer and string what's the difference ?
Date 2011-11-01 12:07 -0700
Organization http://groups.google.com
Message-ID <476405.510.1320174470853.JavaMail.geo-discussion-forums@yqan20> (permalink)
References <f0db0e93-e49e-4bf9-99cc-7caa6fd7c298@g27g2000pro.googlegroups.com>

Show all headers | View raw


http://www.php.net/manual/en/memcache.set.php
http://www.php.net/manual/en/memcache.get.php

bool Memcache::set ( string $key , mixed $var [, int $flag [, int $expire ]] )
string Memcache::get ( string $key [, int &$flags ] )
array Memcache::get ( array $keys [, array &$flags ] )


If you add an integer based key, PHP convert it into string (get or set).
I think if you are add as array (key list) PHP doesn't convert it into string (each item). But when you try to get a single value (1234) as an integer PHP automatically convert it because the function needs a string.

Difference between Integer and String... In php:
"1234" ==    1234    # => true
"1234" === 1234    # => false


I hope, I was able to help you with something (and I don't misunderstand your problem).

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

integer and string   what's the difference ? gaoqiang <gaoqiangscut@gmail.com> - 2011-11-01 06:19 -0700
  Re: integer and string   what's the difference ? richard <member@newsguy.com> - 2011-11-01 11:23 -0400
    Re: integer and string   what's the difference ? Doug Miller <doug_at_milmacdotcom@example.com> - 2011-11-01 13:25 -0400
    Re: integer and string   what's the difference ? Denis McMahon <denismfmcmahon@gmail.com> - 2011-11-01 18:48 +0000
  Re: integer and string   what's the difference ? Balazs Nadasdi <yitsushi@gmail.com> - 2011-11-01 12:07 -0700
  Re: integer and string   what's the difference ? Denis McMahon <denismfmcmahon@gmail.com> - 2011-11-01 19:23 +0000
    Re: integer and string   what's the difference ? Denis McMahon <denismfmcmahon@gmail.com> - 2011-11-01 23:03 +0000
      Re: integer and string   what's the difference ? Denis McMahon <denismfmcmahon@gmail.com> - 2011-11-01 23:36 +0000

csiph-web