Good snippet, nice use of case statements.
However it is a tad useless since you can just do
variable = variable + 1
variable += 1
variable++
and such.
I would rather just use built in functionalities than having to include a function in every PHP script. Still, nice example though.