fixed php version of toOrdinal()