You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Separates any underlying resources from the stream. After the stream has been detached, the stream is in an unusable state.
returnresource|null
Example:
$stream = newStream(fopen('php://temp', 'r+'));
/* ... do something ... */$legacy = $stream->detach();
if (is_resouce($legacy)) {
echo'Resource is detached.';
}
// Outputs: Resource is detached.$legacy = $stream->detach();
if (is_null($legacy)) {
echo'Resource has been null.';
}
// Outputs: Resource has been null.