1.2.151. Closing Tags

PHP manual recommends that script should be left open, without the final closing ?>. This way, one will avoid the infamous bug 'Header already sent', associated with left-over spaces, that are lying after this closing tag.

<?php

// some code

// no closing tag

See also PHP Closing Tag.

1.2.151.1. Suggestions

  • Always leave the last closing tag out

1.2.151.2. Specs

Short name

Php/CloseTags

Rulesets

All, Coding conventions

Exakat since

0.8.4

PHP Version

All

Severity

Minor

Time To Fix

Instant (5 mins)

Precision

Very high

Features

close-tag

ClearPHP

leave-last-closing-out

Available in

Entreprise Edition, Exakat Cloud