Custom JSON Serializer for PHP

The project I am working on currently requires serializing PHP objects into natural JSON. After a while it gets a bit old having to transform those objects into key-value pair arrays to then transform them into JSON using json_encode. An alternative would be to make all properties public and…