
PHP Comparisons
If there is something every developer (not just PHP) should know, it’s when to use a strict equality operator. Interestingly enough, using empty() in PHP has exact behavior as checking loose equality with == false
.
This whole thing was inspired (and partially ripped off of) the JavaScript Equality Table. The design caught my eye, more than anything. I’m kinda wishing most if not all languages would have this kind of basic reference.
In fact, I find it to be a very useful way to document operators. I’m always kicking myself in the head when I go read some lua code which doesn’t use “!=”, but uses “=”, and then there’s other software where the ‘’ character doesn’t mean negation but regular expression (perl =~, nginx regex locations). It’s the little things.
I think that CS knowledge is transferable from one language to the next. If you learn Java or PHP or any other arbitrary languages, you are not locked in to that language - you might have difficulty migrating to C# or LUA or Python, but you can take your logic with you. Your code might not be at the same high standard as your primary language, but it’s function will be.
While I have you here...
It would be great if you buy one of my books:
- Go with Databases
- Advent of Go Microservices
- API Foundations in Go
- 12 Factor Apps with Docker and Go
For business inqueries, send me an email. I'm available for consultany/freelance work. See my page for more detail..
Want to stay up to date with new posts?
Stay up to date with new posts about Docker, Go, JavaScript and my thoughts on Technology. I post about twice per month, and notify you when I post. You can also follow me on my Twitter if you prefer.