Since PHP 8.0, PHP provides the PHP_BUILD_PROVIDER variable to indicate the “origin” of a PHP binary:
https://github.com/php/php-src/commit/ad0d2e438fddc089917e71e5d8909d145db9da8a
The contents of this variable shows up in the PHPInfo output and since PHP 8.4 it also shows up when running php...