One of the big changes in PHP over the last few years has been that emergence of a relatively common set of code quality standards. One of the common problems that PHP programmers can make is mistyping (or, I suppose misunderstanding — but the simple typo seems more common) the difference between == and =. In the programming languages of my youth (I’m looking at you, 1981 Sinclair BASIC), we’d write things like: PHP does away with line numbers, but adds rather more brackets / parentheses, so we have things like the following: In PHP, though, that does not do what you might think. It does not check that x and y are the same, and echo the text if and only if they are.

So the line of code assigns the value of $y to the variable $x, and IF the assignment succeeded, echoes the text.
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