Accessing arrays in objects with PHP : <p>How can I access the TXN_ID in the following object with PHP? Below is a print_r of the object:</p>

<pre><code>$txn_object = $txn_params[last_payment];
error_log( print_r($txn_object,true) );
</code></pre>

<p>I get this in the error log:</p>

<pre><code>EE_Payment Object
(
    [_props_n_values_provided_in_constructor:protected] =&gt; Array(
        [PAY_ID] =&gt; 4168
        [TXN_ID] =&gt; 746919
        [STS_ID] =&gt; PAP
        [PAY_timestamp] =&gt; 2017-08-29 14:06:26
        [PAY_source] =&gt; CART
        [PAY_amount] =&gt; 24.000
        [PMD_ID] =&gt; 11
        [PAY_gateway_response] =&gt; submitted_for_settlement
        [PAY_txn_id_chq_nmbr] =&gt; 96g71gxv
        [PAY_po_number] =&gt; 
        [PAY_extra_accntng] =&gt; 
        [PAY_details] =&gt; 
    )
)
</code></pre>

<p>I've tried a few things, but can't seem to get that value but comes back blank:</p>

<pre><code>$txn_object-&gt;_props_n_values_provided_in_constructor[0]-&gt;TXN_ID
</code></pre>
