Annoyingly the NaN (not a number) value of Number objects in AS3 is often quite hard to translate into a server-side equivalent and ends up breaking AMFPHP, and apparently BlazeDS too.
Here is a simple modification that will make AMFPHP turn NaN into a PHP null value on de-serialization. Unfortunately on the return journey – trying to return NaN to AS3 – there doesn’t seem to be anything clever that can be done and the Flash Player insists on turning undefined numbers into 0. A glance through the AMF spec doesn’t reveal anything useful, and if you need this functionality you are best off creating a custom class wrapping the value of the number and including a isNotANumber:Boolean or something that you can examine and set on the server.
Anyway, here’s the code. In AMFBaseDeserializer.php find the following function:
and change the last line so it reads:
Hope that helps someone!