---
title: "PHP coding guidelines"
manual: "TYPO3 Explained"
version: "14.3"
permalink: "https://docs.typo3.org/permalink/t3coreapi:cgl-php@14.3"
source: "CodingGuidelines/CglPhp/Index.rst"
rendered: "2026-10-01T15:20:05+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@14.3),
[Extension files and locations](https://docs.typo3.org/permalink/t3coreapi:extension-files-locations@14.3)
and [PHP file namespaces](https://docs.typo3.org/permalink/t3coreapi:namespaces@14.3).

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