src/shmop.php
protected function write($data, int $seconds = 0): bool
    {
        if (!$data) {
            return false;
        }

        $this->clean();

        $data = $this->pack($data, $seconds);

        $id = shmop_open($this->id, "n", $this->mode, strlen($data));
        if (!$id) {
            return false;
        }

        $size = shmop_write($id, $data, 0);

        return !empty($size);
    }
protected function write($data, int $seconds = 0): bool
    {
        if (!$data) {
            return false;
        }

        $this->clean();

        $data = $this->pack($data, $seconds);

        $id = shmop_open($this->id, "n", $this->mode, strlen($data));
        if (!$id) {
            return false;
        }

        $size = shmop_write($id, $data, 0);

        return !empty($size);
    }
protected function write ( $ data , int $ seconds = 0 ) : bool { if ( ! $ data ) { return false ; } $ this -> clean ( ) ; $ data = $ this -> pack ( $ data , $ seconds ) ; $ id = shmop_open ( $ this -> id , "n" , $ this -> mode , strlen ( $ data ) ) ; if ( ! $ id ) { return false ; } $ size = shmop_write ( $ id , $ data , 0 ) ; return ! empty ( $ size ) ; }
Write data into shared memory block
@param mixed $data
@param int $seconds [optional]
@return bool
Write data into shared memory block