Scout APM helps PHP developers pinpoint N+1 queries, memory leaks & more so you can troubleshoot fast & get back to coding faster. Let's start with PHP 5.6, this is what most people without modern-day PHP knowledge probably think PHP code still looks like. I'll just give you the code, and I'll mention what changes in future versions.

Nullable types aren't a thing yet, so we still need to use doc block types for our nullable $publishedAt: With PHP 7.1 finally came nullable types, so we could remove some more doc blocks: While there were some exciting features in 7.2 like parameter type widening and the object type, there's nothing we could do to clean up our specific DTO in this release.

If you want to stay up to date about what's happening on this blog, you can follow me on Twitter or subscribe to my newsletter: EmailSubscribe
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