PHPackages                             clbustos/beautifier - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. clbustos/beautifier

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

clbustos/beautifier
===================

PHP\_Beautifier is a Open Source PHP aplication, distributed under the terms of PHP Licence 3.0. This program tries to reformat and beautify PHP 4 and PHP 5 code automatically.

027PHP

Since Jun 4Pushed 10y ago1 watchersCompare

[ Source](https://github.com/kuldipem/PHP_Beautifier)[ Packagist](https://packagist.org/packages/clbustos/beautifier)[ RSS](/packages/clbustos-beautifier/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

\#What is PHP\_Beautifier? #

PHP\_Beautifier is a Open Source PHP aplication, distributed under the terms of PHP Licence 3.0. This program tries to reformat and beautify PHP 4 and PHP 5 code automatically. Who needs it?

- developers who get PHP code from other coders and are slightly confused
- developers who can't read their own PHP code anymore
- developers who want to share their PHP code

\#Little history background #

The first version of the program, PhpBeautify, was developed on Php 4 by Jens Bierkandt. In 2003 reached the 'stable' state and is the recomended version for the Php 4 users. This version works almost flawlessy, but was difficult to enhance, and have some problem with strange structures, like pascal-like control instructions and 'switch' structures

With the stabilization of tokenizer and incoming of PHP 5, the need of a new version of the program arise. So, the code for the new version was developed from scratch by Claudio Bustos in 2004, based on the Php Tokenizer and the use of a Plug-in architecture. Where I can get PHP\_Beautifier?

PHP\_Beautifier resources are distributed on three sites:

- PEAR: Download, Change Log and bug report
- Github: Sourcecode (GIT), wiki and forum

Features of PHP\_Beautifier
===========================

[](#features-of-php_beautifier)

- Version independent: Needs PHP5 to work, but can handle PHP 4 and PHP 5 scripts. Should beautify PHP 3, too (if anyone test it, please send a report)
- Plataform-independent: Should work on all the plataforms that supports PHP 5. Tested on Windows 98,2000,XP and Linux Gentoo 1.4.6
- Automatic indentation of PHP source code according to given number of spaces
- Automatic newlines, if required
- You can use the web frontend, command line or, if you prefer, could use the class directly
- Plug-in architecture, by the use of Filters. The control of beautify proccess is delegated on the Filters.
- The code to beautify can make callbacks to the base class and the filters. So, you can set the options for the beautify inside the same file. See Callbacks
- Batch processing. You can beautify multiple files inside directories (recursively, if you want to) and save they in another directory.
- Parse only Php Code. All other tokens (HTML,Comments) are bypassed to the output
- HEREDOC parsed without any indentation
- Use of braces for indexing a string (ex. $this-&gt;myString{1}) doesn't produce strange indentation
- Switch statements are indented as spected

Works with PHP 4 scripts? Will be a PHP 4 version?
==================================================

[](#works-with-php-4-scripts-will-be-a-php-4-version)

This package needs PHP 5 to run, but can handle any PHP file, including PHP 4 and PHP 5 scripts.

In the near future, no. The use of exceptions, overloading &amp; tokenizer - both experimental on PHP 4 - and passing by reference by default for objects could be simulated, but I prefer to focus my effort on PHP 5. But this only affect the installation of the package; you can beautify script written for PHP 4 and PHP 5, without any problem.

Is secure to use?
=================

[](#is-secure-to-use)

The source code of the package beautify itself without any problem. I work with an application with more than 40.000 lines of PHP 4 source code and I did't have any broken file since 0.0.6 version.

The package have a test suite to verify all the important functions. Any bug have a test to verify the fix.

So, IMHO, you can use this application with confidence. Anyway, you always should make regular backups of your files and use some control version system, like CVS or Subversion.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 58.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e0783913278f0c93b9e11961e998ea76d56607caa093794f88bf38d16b8395f3?d=identicon)[kuldipem](/maintainers/kuldipem)

---

Top Contributors

[![clbustos](https://avatars.githubusercontent.com/u/228928?v=4)](https://github.com/clbustos "clbustos (56 commits)")[![jespino](https://avatars.githubusercontent.com/u/290303?v=4)](https://github.com/jespino "jespino (20 commits)")[![csirmaz](https://avatars.githubusercontent.com/u/3897958?v=4)](https://github.com/csirmaz "csirmaz (9 commits)")[![kuldipem](https://avatars.githubusercontent.com/u/2017625?v=4)](https://github.com/kuldipem "kuldipem (5 commits)")[![kcivey](https://avatars.githubusercontent.com/u/61062?v=4)](https://github.com/kcivey "kcivey (3 commits)")[![dohzoh](https://avatars.githubusercontent.com/u/2069884?v=4)](https://github.com/dohzoh "dohzoh (2 commits)")

### Embed Badge

![Health badge](/badges/clbustos-beautifier/health.svg)

```
[![Health](https://phpackages.com/badges/clbustos-beautifier/health.svg)](https://phpackages.com/packages/clbustos-beautifier)
```

###  Alternatives

[sskaje/mqtt

sskaje's MQTT Class

8769.5k1](/packages/sskaje-mqtt)[birgir/geo-query

Modify the WP\_Query to support the geo\_query parameter. Uses the Haversine SQL optimization by Ollie Jones.

683.0k](/packages/birgir-geo-query)[breadlesscode/neos-blog

Ready to use blog package

161.4k](/packages/breadlesscode-neos-blog)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
