If you’re trying to directly compare different variable types in any language without strong typing, you’re going to have edge-case results which you might not expect.
My “coding like a moron” message still stands. PHP isn’t a strongly typed language and it doesn’t tell you off for trying stupid stuff like comparing a string with an int. Nor do other languages like JavaScript.
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmerhumor@lemmy.ml
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
Posts must be relevant to programming, programmers, or computer science.
No NSFW content.
Jokes must be in good taste. No hate speech, bigotry, etc.
If you’re trying to directly compare different variable types in any language without strong typing, you’re going to have edge-case results which you might not expect.
My “coding like a moron” message still stands. PHP isn’t a strongly typed language and it doesn’t tell you off for trying stupid stuff like comparing a string with an int. Nor do other languages like JavaScript.
Also using duck typing fails against php is pretty funny when it’s being compared against JAVASCRIPT of all things.