Please note, this will not do anything with properties that start with a double underscore or that use invalid PHP variable naming conventions (yes, that is a design decision).
Thanks to Jason Memory at Full Throttle Web Solutions for his RegEx assistance.