PHP test suite file
File type: Source code and script file
A PHPT file is a plain-text test case used by the PHP test suite to check PHP behavior.
File type category:
Source code and script file
Date updated: November 14, 2026
PHPT files belong to the PHP test suite, maintained by the PHP project for the PHP scripting language. They are used to verify PHP and its extensions across supported platforms.
A PHPT file can contain test instructions, PHP code to run, and expected output for comparison. The sections are marked with labels such as --TEST--, --FILE--, and --EXPECT--. The PHP test runner, run-tests.php, uses these sections to execute the test and check its result.
These files are typically kept in the PHP source tree alongside the code they test. The PHPT format remains in use for PHP development and testing; a PHPT file is a test case, not a PHP script for serving a web page.
To inspect the contents, open the PHPT file in a text editor. To run it, use PHP's run-tests.php from a PHP source tree with a suitable PHP build, for example: php run-tests.php path/to/test.phpt.
No standard conversion is needed or generally useful: a PHPT file is a text-based test case whose sections are interpreted by PHP's test runner. Editing or exporting it as another format may prevent the runner from recognizing the test.
Software applications that handle other tasks involving phpt files:
Multiplatform