src/Fasim/Cache/simulate/Memcached.php
public function set($key, $val, $expt = 0)
    {
        $valueString = serialize($val);
        $keyString = $this->getKey($key);

        $this->writeSocket(
            "set $keyString 0 $expt " . strlen($valueString)
        );
        $s = $this->writeSocket($valueString, true);

        if ('STORED' == $s) {
            $this->resultCode = Memcached::RES_SUCCESS;
            $this->resultMessage = '';
            return true;

        } else {
            $this->resultCode = Memcached::RES_FAILURE;
            $this->resultMessage = 'Set fail.';
            return false;
        }
    }
public function set($key, $val, $expt = 0)
    {
        $valueString = serialize($val);
        $keyString = $this->getKey($key);

        $this->writeSocket(
            "set $keyString 0 $expt " . strlen($valueString)
        );
        $s = $this->writeSocket($valueString, true);

        if ('STORED' == $s) {
            $this->resultCode = Memcached::RES_SUCCESS;
            $this->resultMessage = '';
            return true;

        } else {
            $this->resultCode = Memcached::RES_FAILURE;
            $this->resultMessage = 'Set fail.';
            return false;
        }
    }
public function set ( $ key , $ val , $ expt = 0 ) { $ valueString = serialize ( $ val ) ; $ keyString = $ this -> getKey ( $ key ) ; $ this -> writeSocket ( "set $keyString 0 $expt " . strlen ( $ valueString ) ) ; $ s = $ this -> writeSocket ( $ valueString , true ) ; if ( 'STORED' == $ s ) { $ this -> resultCode = Memcached :: RES_SUCCESS ; $ this -> resultMessage = '' ; return true ; } else { $ this -> resultCode = Memcached :: RES_FAILURE ; $ this -> resultMessage = 'Set fail.' ; return false ; } }
Store an item

@param   string  $key
@param   mixed   $val
@param   int     $expt
@return  boolean
Store an item