Set default value with PHP on a node field.
I don't know if there is an UI for it, but fields allows either an array as allowed values or an callback.

This means that you most likely will need to create a function in a module instead of hardcoding the php which then would be saved in the database. IMO this is a good thing.

In your field config array you want something like this:

....
'settings' =&gt; array(
    'allowed_values' =&gt; array(),
    'allowed_values_function' =&gt; 'callback_function',
),
...


If you are new to this, take a look at field_create_field and field_update_field.