Refactor #10100 Add PHP compatible functions
http://tracker.modx.com/issues/10100