php rebase functions