This is a lightweight, easy-to-use complex number class in PHP. It contains methods representing the basic operations, such as addition, subtraction, multiplication, exponentiation and square root calculation, and also a few complex number specific methods (polar form, conjugate etc.).
As I described here I had to solve quartic equations to overcome a geometric problem in my StellaSphaera project, which wouldn't be possible without a complex number class. So first I tried the PEAR library but for me it was too cumbersome and verbose. As I couldn't find any better solution, I decided to create my own complex number class. Because PHP doesn't support operator overloading it is impossible to deal with complex numbers in the same natural way as we do with integers and floats. However I tried to reduce the roundabouts, so that it is easy to chain operations to create compact, one-line expressions. In addition methods both accept complex and real numbers (integer, float) as arguments, so you don't need to always create a new complex object to pass a real number to a method as with the PEAR class. I only implemented a few operations, but in most cases I think this set is enough or being an open source library it can be easily extended.