How do I calculate the days difference between start and end date of a date range field in Views PHP?
Within Views PHP, there are 2 fields. The value code field and the output code field. The first is used to calculate the value (for filtering, sorting, etc). The second is used to display the value.

So in the first field you'll have to perform your calculations and return the final value. If your field is numeric, try to only calculate the number here. Prefixes and suffixes can be added in the output field. (So the value for this field could be 3.)

In the output field you again have to return the final value. This can be the same value as calculated in the value field (there is a token for this value). But you can also append pre- and suffixes and return a string. (Here you can for instance append days to the value to have it display 3 days.)