1.2.847. Non Breakable Space In Names

PHP allows non-breakable spaces in structures names, such as class, interfaces, traits, and variables.

This may be a nice trick to make names more readable outside code context, like long-named methods for tests. Original post by Matthieu Napoli. .

<?php

class class with non breakable spaces {}

class ClassWithoutNonBreakableSpaces {}

?>

See also Using non-breakable spaces in test method names and PHP Variable Names.

1.2.847.1. Specs

Short name

Structures/NonBreakableSpaceInNames

Rulesets

All, Appinfo, CE

Exakat since

0.12.0

PHP Version

All

Severity

Time To Fix

Precision

Very high

Features

non-breakable-space

Available in

Entreprise Edition, Community Edition, Exakat Cloud