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

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners