Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<SyncReaderWriter::writeunlockSyncSharedMemory::__construct>
^SyncLast updated: Mon, 26 Oct 2026

The SyncSharedMemory class

(PECL sync >= 1.1.0)

Introduction

A cross-platform, native, consistent implementation of named shared memory objects.

Shared memory lets two separate processes communicate without the need for complex pipes or sockets. There are several integer-based shared memory implementations for PHP. Named shared memory is an alternative.

Synchronization objects (e.g. SyncMutex) are still required to protect most uses of shared memory.

Class synopsis

class SyncSharedMemory {
/* Methods */
public function __construct(string $name, int $size)
public function first(): bool
public function read(int $start = 0, int $length = ?)
public function size(): int
public function write(string $string = ?, int $start = 0)
}

Table of Contents


<SyncReaderWriter::writeunlockSyncSharedMemory::__construct>
^SyncLast updated: Mon, 26 Oct 2026