silent.php
Table of Contents
Functions
- silent() : string|null
- Appends a redirection string to suppress output from a shell command.
Functions
silent()
Appends a redirection string to suppress output from a shell command.
silent(string|null &$command[, bool $silent = false ]) : string|null
This helper function modifies the given command string in-place by appending a platform-appropriate silence directive:
- On Unix/Linux/macOS:
> /dev/null 2>&1
- On Windows:
> NUL 2>&1
This is typically used to hide output when executing shell commands.
Parameters
- $command : string|null
-
The command string to modify by reference.
- $silent : bool = false
-
Whether to append the silence directive to the command.
Tags
Return values
string|null —The updated command string (or null if input was null).