PHP implementation of the Java inspired StringBuilder