---
title: "PHP_CodeSniffer - checking PHP 5.3 compatibility"
date: "2011-02-24"
modified: "2013-03-04"
path: "/67-php_codesniffer-checking-php-5-3-compatibility.html"
section: "/ramblings"
aliases:
  - "/67"
  - "/67-php_codesniffer-checking-php-5-3-compatibility"
  - "/67.html"
  - "/blog/phpcodesniffer-checkingphp53compatibility"
  - "/ramblings/67-php_codesniffer-checking-php-5-3-compatibility.html"
---

Install Code Sniffer

```
pear install PHP_CodeSniffer
```

Install GIT:

```
apt-get install git-core
```

Change to working Code Sniffer folder:

```
cd /usr/share/php/PHP/CodeSniffer/Standards/
```

Run GIT to get file:

```
git clone git://github.com/wimg/PHP53Compat_CodeSniffer.git PHP53Compat
```

Change to folder

```
cd PHP53Compat
```

Change to working source code folder:

```
cd /home/client/public_html
```

Run the script, setting current path

```
phpcs --standard=PHP53Compat ./
```

Resources:\
\[1\] [http://pear.php.net/package/PHP_CodeSniffer](http://pear.php.net/package/PHP_CodeSniffer)<br>
\[2\] <http://linux.koolsolutions.com/2009/08/07/learn-git-series-part-1-installing-git-on-debian/><br>
\[3\] <http://techblog.wimgodden.be/2010/06/24/automated-php-5-3-compatibility-testing-for-your-old-code/>
