WordPress checks the PHP interpreter before loading core files. If the interpreter reports a version lower than the minimum required, WordPress stops execution and shows the error.
The check runs in wp_check_php_version(). It compares the detected version with the requirement defined for the installed WordPress release.