Category: PHP, PHP, api, api

PHP is like a kindly old aunt who doesn’t like to correct the young’ins even though she knows they’ve done wrong. In her head, she’s saying “Oh, so-and-so, that’s so cute,” while in her head she’s sadly contemplating the genetic lottery that led someone to try to fetch an object property from a variable that isn’t an object at all.

But what is an object in PHP?

And as you can see, the fix is as simple as can be: Here’s a final example of an externally sourced piece of data that occasionally threw a log notice about trying to get a property on a non-object: On the surface it seems well and good: there’s even a check for whether the json_decode() worked in line 12.

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox.Explore
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners