---
title: "PHP coding guidelines"
manual: "TYPO3 Explained"
version: "13.4"
permalink: "https://docs.typo3.org/permalink/t3coreapi:cgl-php@13.4"
source: "CodingGuidelines/CglPhp/Index.rst"
rendered: "2026-10-05T17:28:20+00:00"
---

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

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