Or you may want to try to convert $degrees to long:

```c
if (Z_TYPE_P(degrees) != IS_LONG) {
    PHALCON_SEPARATE_PARAM(degrees);
    convert_to_long(degrees);
}
```