Author Topic: Fuck you PHP!  (Read 2054 times)

micah

  • A man on the Internet.
  • Jackass In Charge
  • Posts: 6493
  • Karma: +55/-55
  • Good man. Nixon's pro-war and pro-family.
    • micahj.com
Re: Fuck you PHP!
« Reply #15 on: June 28, 2018, 10:30:49 PM »
curious, what would you expect the outcome to be, casting a string as an integer?

"I possess a device, in my pocket, that is capable of accessing the entirety of information known to man.  I use it to look at pictures of cats and get in arguments with strangers."

Mike

  • Ass Wipe
  • Posts: 11939
  • Karma: +168/-32
  • Ex Asshole - a better and more caring person.
Re: Fuck you PHP!
« Reply #16 on: June 29, 2018, 12:54:33 AM »
Doing something similar in Python throws an exception.  That is what I would expect.  Or return null as that would signify that the operation failed.
« Last Edit: June 29, 2018, 05:27:13 PM by Mike »

micah

  • A man on the Internet.
  • Jackass In Charge
  • Posts: 6493
  • Karma: +55/-55
  • Good man. Nixon's pro-war and pro-family.
    • micahj.com
Re: Fuck you PHP!
« Reply #17 on: June 29, 2018, 03:20:29 PM »
ah, i see what you mean. Yeah, PHP can be pretty lenient with things that you'd think shouldn't work.  Learning typescript now and I'm seeing how strict other languages can really be.  It's a bit eye-opening.

"I possess a device, in my pocket, that is capable of accessing the entirety of information known to man.  I use it to look at pictures of cats and get in arguments with strangers."