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 ?

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!newsfeed.x-privat.org!news-xxxfer.readnews.com!news-out.readnews.com!transit3.readnews.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
From Balazs Nadasdi <yitsushi@gmail.com>
Newsgroups comp.lang.php
Subject Re: integer and string what's the difference ?
Date Tue, 1 Nov 2011 12:07:50 -0700 (PDT)
Organization http://groups.google.com
Lines 17
Message-ID <476405.510.1320174470853.JavaMail.geo-discussion-forums@yqan20> (permalink)
References <f0db0e93-e49e-4bf9-99cc-7caa6fd7c298@g27g2000pro.googlegroups.com>
Reply-To comp.lang.php@googlegroups.com
NNTP-Posting-Host 80.98.114.238
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
X-Trace posting.google.com 1320174473 8917 127.0.0.1 (1 Nov 2011 19:07:53 GMT)
X-Complaints-To groups-abuse@google.com
NNTP-Posting-Date Tue, 1 Nov 2011 19:07:53 +0000 (UTC)
In-Reply-To <f0db0e93-e49e-4bf9-99cc-7caa6fd7c298@g27g2000pro.googlegroups.com>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=80.98.114.238; posting-account=VX4umQoAAADT3chjlyUzLgOlBX6TtELf
User-Agent G2/1.0
X-Google-Web-Client true
Xref x330-a1.tempe.blueboxinc.net comp.lang.php:3647

Show key headers only | 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