php8.5
Home/ Manual/ spl / splsubject/ SplSubject::attach

SplSubject::attach

PHP function Edit on GitHub ✎

(PHP 5 >= 5.1.0, PHP 7, PHP 8)

Attach an SplObserver

Description

SplSubject::attach(SplObserver $observer): void

Attaches an SplObserver so that it can be notified of updates.

Func

Parameters

observer

The SplObserver to attach.

Return Values

Void

Source: reference/spl/splsubject/attach.xml · from the official PHP manual (php/doc-en)