1. The PHP Group, PHP Manual, "What is PHP?". "PHP is a popular general-purpose scripting language that is especially suited to web development. [...] But PHP can do much more. There are three main areas where PHP scripts are used. - Server-side scripting. [...] - Command line scripting. [...] - Writing desktop applications." This section explicitly states the main uses, including both server-side (web) and command-line scripting.
Source: https://www.php.net/manual/en/intro-whatis.php
2. The PHP Group, PHP Manual, "Using PHP from the command line". "PHP is not only for creating web pages. Since PHP 4.3.0, PHP has a new SAPI type named CLI, which stands for Command Line Interface. As the name implies, this SAPI type main focus is on developing shell (or desktop) applications with PHP." This document details the existence and purpose of the CLI, confirming its use beyond web applications.
Source: https://www.php.net/manual/en/features.commandline.php