DRY up php shim