If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Actually, the following statement is the something that's between the function definition and the first usage.

Code:

$aimdata->fields = array();

Since it's $aimdata->fields that's being assigned that empty array, that's where the issue arises because $aimdata is not an object. I do agree that the change could be simplified as follows to "prepare" for the use of that required handling:

Note: an if statement/conditional test was not used/needed before the first $aimdata-> and that the assignment within the previous if statement was still used/needed.

Although no question was asked nor a statement directly made of not understanding the textual description, the following expanded and broken down information is provided. In my opinion likely to still be misunderstood, but please ask away about whatever is confusing or not understood or where I have possibly used incorrect terminology.

And therefore could be written without the if statement as described previously in text, as provided above (ie lat9's post) and as DrByte indicated in the rework of ZC to elimate the error/improve the code.

Again though as discussed if there have been other edits to the code above the first use of $aimdata->, then the if statement may be necessary. But there has not been any indication of such. If there has been such an edit, it would be beneficial to know about so that one can evaluate whether the if statement is in fact necessary or not.

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.