Odd PHP hex string behaviour

It strikes me as slightly odd that:

is_numeric("0xaa") === true
(float)"0xaa" == 0
(float)("0xaa"+0) == 170

The same's true casting to int. Similarly annoyingly:

is_numeric("5e2") === true
(float)"5e2" == 500
(int)"5e2" == 5
(int)("5e2"+0) == 500

So, don't assume that if is_numeric($value) you can cast $value to a numeric type directly! I'm sure this is documented somewhere in the PHP docs, but there's an awful lot of slightly odd special cases I'd have to wade through to find it.