implement string to number coercion in a more PHP way.
Merge pull request #1 from rfw/master

string to numeric coercion