A rebase tutorial in PHP