Test
You should better test your code, probably practicing TDD. You can do this thanks to PHPUnit. Keep in mind Uncle Bob's three rules to practice TDD.
- You are not allowed to write any production code unless it is to make a failing unit test pass.
- You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failures.
- You are not allowed to write any more production code than is sufficient to pass the one failing unit test.
You must begin by writing a unit test for the functionality that you
intend to write. But by rule 2, you can't write very much of that unit
test. As soon as the unit test code fails to compile, or fails an
assertion, you must stop and write production code. But by rule 3 you
can only write the production code that makes the test compile or
pass, and no more.
If you think about this you will realize that you simply cannot write
very much code at all without compiling and executing something.
Indeed, this is really the point. In everything we do, whether writing
tests, writing production code, or refactoring, we keep the system
executing at all times. The time between running tests is on the order
of seconds, or minutes. Even 10 minutes is too long.
You should try to have high code coverage. PHPUnit can also do code coverage analyses thanks to xdebug. Refactoring code that is smelly(list) should be easy, because of your test-cases which are already present.
Security
Performance
Caching the compiled bytecode of PHP scripts to avoid the overhead of
parsing and compiling source code on each request (some or all of
which may never even be executed). To further improve performance, the
cached code is stored in shared memory and directly executed from
there, minimizing the amount of slow disk reads and memory copying at
runtime.
The famous quotation, "We should forget about small efficiencies, say
about 97% of the time: premature optimization is the root of all
evil", by Donald Knuth,6 has also been mistakenly attributed to
Hoare (by Knuth himself), although Hoare disclaims authorship.