SyncSharedMemory::read

(PECL sync >= 1.1.0)

SyncSharedMemory::readCopy data from named shared memory

Beschreibung

public SyncSharedMemory::read(int $start = 0, int $length = ?)

Copies data from named shared memory.

Parameter-Liste

start

The start/offset, in bytes, to begin reading.

Hinweis:

If the value is negative, the starting position will begin at the specified number of bytes from the end of the shared memory segment.

length

The number of bytes to read.

Hinweis:

If unspecified, reading will stop at the end of the shared memory segment.

If the value is negative, reading will stop the specified number of bytes from the end of the shared memory segment.

Rückgabewerte

A string containing the data read from shared memory.

Beispiele

Beispiel #1 SyncSharedMemory::__construct() example

<?php
// You will probably need to protect shared memory with other synchronization objects.
// Shared memory goes away when the last reference to it disappears.
$mem = new SyncSharedMemory("AppReportName"1024);
if (
$mem->first())
{
    
// Do first time initialization work here.
}

$result $mem->write("report.txt");

$result $mem->read(3, -4);
var_dump($result);
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

string(3) "ort"

Siehe auch

Hier Kannst Du einen Kommentar verfassen


Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

Was genau bedeutet "Vibe Coding"? Ein tiefgehender Blick für Entwickler

In der Welt der Softwareentwicklung gibt es unzählige Wege, wie man an ein Projekt herangeht. Manche schwören auf strikte Planung, andere auf bewährte Algorithmen und wieder andere lassen sich von etwas ganz anderem leiten: ihrem Gefühl. ...

admin

Autor : admin
Kategorie: Software & Web-Development

PHP cURL-Tutorial: Verwendung von cURL zum Durchführen von HTTP-Anfragen

cURL ist eine leistungsstarke PHP-Erweiterung, die es Ihnen ermöglicht, mit verschiedenen Servern über verschiedene Protokolle wie HTTP, HTTPS, FTP und mehr zu kommunizieren. ...

TheMax

Autor : TheMax
Kategorie: PHP-Tutorials

Midjourney Tutorial - Anleitung für Anfänger

Über Midjourney, dem Tool zur Erstellung digitaler Bilder mithilfe von künstlicher Intelligenz, gibt es ein informatives Video mit dem Titel "Midjourney Tutorial auf Deutsch - Anleitung für Anfänger" ...

Mike94

Autor : Mike94
Kategorie: KI Tutorials

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

MMOEXP:EA Sports FC 27: Here’s Everything We Know So Far

MMOEXP offers one of the most reliable solutions for purchasing game currency, items,accounts, and more. You can now use the exclusive discount co ...

Geschrieben von ehju am 08.09.2026 08:09:24
Forum: Off-Topic Diskussionen
100% Pure Research Chemical - Click to Buy Pure Blue Molly Stone, Vyvanse Online

Mega Chemical Island is a top research chemical vendor with many years of supply experience. Mega Chemical Island offers a large number of researc ...

Geschrieben von megachemisland am 07.09.2026 20:25:12
Forum: Provider / Domains
100% Pure Research Chemical - Click to Buy Pure Blue Molly Stone, Vyvanse Online

Mega Chemical Island is a top research chemical vendor with many years of supply experience. Mega Chemical Island offers a large number of researc ...

Geschrieben von megachemisland am 07.09.2026 20:24:19
Forum: Entwicklungsumgebungen
100% Pure Research Chemical - Click to Buy Pure Blue Molly Stone, Vyvanse Online

Mega Chemical Island is a top research chemical vendor with many years of supply experience. Mega Chemical Island offers a large number of researc ...