---
title: "PHP coding guidelines"
manual: "TYPO3 Explained"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3coreapi:cgl-php@main"
source: "CodingGuidelines/CglPhp/Index.rst"
modified: "2026-09-16T13:05:25+00:00"
---

# PHP coding guidelines

This part is about structure and formatting of PHP files. For an overview of file locations,
PHP namespaces and general TYPO3 directories, please refer to
[TYPO3 directory structure](https://docs.typo3.org/permalink/t3coreapi:directory-structure@main),
[Extension files and locations](https://docs.typo3.org/permalink/t3coreapi:extension-files-locations@main)
and [PHP file namespaces](https://docs.typo3.org/permalink/t3coreapi:namespaces@main).

-   [General requirements for PHP files](https://docs.typo3.org/permalink/t3coreapi:general-requirements-for-php-files@main)
-   [File structure](https://docs.typo3.org/permalink/t3coreapi:file-structure@main)
-   [PHP syntax formatting](https://docs.typo3.org/permalink/t3coreapi:php-syntax-formatting@main)
-   [Using phpDoc](https://docs.typo3.org/permalink/t3coreapi:using-phpdoc@main)
