How can I set a node reference programmatically?
First, I"ll answer your question, then suggest another way.

Assuming that this is a monolingual site, use

$additional_node-&gt;field_created_node[LANGUAGE_NONE][0]['nid'] = $created_node-&gt;nid;

However, Rules already has actions that can change values on a node, and when you create a node using Rules, it creates a new variable containing the created node. If I were you, I'd just add actions that use that data and not write custom PHP code to do it. I just created one to assign populate a user reference field on a created node (within the same rule) the other day, and it worked fine.