KB: Function parameters passed into a PHP extension are mangled and unusable
If you are experiencing the situation where some or all parameters being passed into a function that resides in a PHP extension then consider the following.
Make sure any optimisations have been DISABLED. On CentOS, this was causing strings and zvals to be mangled.
If you are passing any numeric values denoted with "l" (L), make sure they are being stored in "long" type variables. On 64-bit system, if you are using int's then the memory alignment will be wrong.