Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vajricaaaa's avatar

Attempt to read property on array

a

0 likes
4 replies
ramonrietdijk's avatar

What if you change $device->ipPricingId to $device['ipPricingId'], does that work?

It would help if you could dd($device); to see what the variable $device actually is.

ramonrietdijk's avatar

@vajricaaaa Since it is an array, I assume that one of the iterations does not have (all) the data available.

$ip_info_row[14] = 'Processing - '.($device['ipPricingId'] ?? '--');

What about that?

gty's avatar

@vajricaaaa Add a check if key ipPricingId exists in array $device before trying to access it:

$ip_info_row[14] = 'Processing - ' . (array_key_exists('ipPricingId', $device) ? $device['ipPricingId'] : '--');

Please or to participate in this conversation.