---
title: "PHP coding guidelines"
manual: "TYPO3 Explained"
version: "11.5"
permalink: "https://docs.typo3.org/permalink/t3coreapi:cgl-php@11.5"
source: "CodingGuidelines/CglPhp/Index.rst"
rendered: "2026-10-21T15:30:00+00:00"
---

<a id="cgl-php-file-formatting"></a>

# PHP coding guidelines {#cgl-php}

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@11.5),
[Extension files and locations](https://docs.typo3.org/permalink/t3coreapi:extension-files-locations@11.5)
and [PHP file namespaces](https://docs.typo3.org/permalink/t3coreapi:namespaces@11.5).

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