Trying to get a field from a fetched entity in rules I'm trying to use PHP evaluation in rules, and I'm having some trouble getting the data.

This is the beginning of the variable $entity_fetched:

Test 103
stdClass Object
(
[vid] =&gt; 611
[uid] =&gt; 1
[title] =&gt; Test 103
[log] =&gt;
[status] =&gt; 1
[comment] =&gt; 1
[promote] =&gt; 1
[sticky] =&gt; 0
[nid] =&gt; 611
[type] =&gt; calendar_event
[language] =&gt; und
[created] =&gt; 1380898459
[changed] =&gt; 1380898459
[tnid] =&gt; 0
[translate] =&gt; 0
[revision_timestamp] =&gt; 1380898459
[revision_uid] =&gt; 1
[body] =&gt; Array
(
)
[field_date_time] =&gt; Array
(
[und] =&gt; Array
(
[0] =&gt; Array
(
[value] =&gt; 1380898800
[value2] =&gt; 1380898800
[timezone] =&gt; America/Detroit
[timezone_db] =&gt; UTC
[date_type] =&gt; datestamp


I'm trying to get the value under field_date_time, but trying to get it as an array gives me an error that I am trying to get arrays from a stdClass object.

&lt;?php print_r($entity_fetched['field_date_time']['und']['0']['value']); ?&gt;


So then I try to do this:

&lt;?php print_r($entity_fetched-&gt;field_date_time-&gt;und-&gt;0-&gt;value); ?&gt;


and it gives me an error:

Parse error: syntax error, unexpected T_LNUMBER, expecting T_STRING or T_VARIABLE 


What am I doing wrong here? How do I get this information?
Correct way to get the value is:

&lt;?php print_r($entity_fetched-&gt;field_date_time['und']['0']['value']); ?&gt;


The $entity_fetched is returning an object so to access it values you would need to use -&gt; operator, and than you have array contents which you can access using the array subscript operator []. 

Note: You cannot access object members via the array subscript operator [].
For accessing the object members you need to use the -&gt; operator.
And to access the array contents we use the [] operator.