# New function `stream_isatty()`

> Section in “New and Extended Functionality › I/O and Filesystem” of the book [PHP 7 Explained](https://php7explained.com/) by Sebastian Bergmann and Stefan Priebsch, published by thePHP.cc. The book covers PHP 7.0 to 7.4 and was last updated in November 2020. HTML version: <https://php7explained.com/new-and-extended-functionality/io-and-filesystem/new-function-stream_isatty/>

CLI applications often need to know whether or not they are running in a terminal (TTY), for instance to decide whether output should be generated or what level of verbosity to use. As of PHP 7.2, the `stream_isatty()` function can be used on any resource type, returning `true` if the supplied resource is a TTY and `false` in case it is not.

---

Previous: [Output Buffering and ignore_user_abort()](https://php7explained.com/new-and-extended-functionality/io-and-filesystem/output-buffering-and-ignore_user_abort/index.html.md) | Next: [Stream Context Option on Windows](https://php7explained.com/new-and-extended-functionality/io-and-filesystem/stream-context-option-on-windows/index.html.md)
