This is automatic generated document for things in Swow\Stream\VarStream class

Class VarStream

Length-prefixed stream that exchanges PHP variables through serialize().

The payload of a received message comes from the peer and is passed to unserialize() as it is. When the peer is not trusted, pass [‘allowed_classes’ => false] or an explicit class list to recvVar(), the same way unserialize() takes it: otherwise the peer decides which classes this process instantiates and which __wakeup() or __destruct() methods run.

The message length is not limited by default; use setMaxMessageLength() when the peer can not be trusted to send a length it actually delivers.

Methods

Method __construct

public function __construct ( int $type )

Method recvVar

public function recvVar ( array<string, mixed> $options , ?int $timeout ) : mixed

Param array<string, mixed> $options unserialize() options, see the class documentation about allowed_classes

Method sendVar

public function sendVar ( mixed $var , ?int $timeout ) : static

Copyright 2022 the Swow contributors

This site uses Just the Docs, a documentation theme for Jekyll.