• Rikudou_SageA
    link
    15 months ago

    It’s all down to typing system. In PHP, providing null to string argument is a TypeError. You have to use ?string. Same in Typescript in strict mode. In Java, you can happily use null for everything without typesystem catching it.

    NaN is a float standard thing, every language that implements floats has NaN.

    • @dohpaz42@lemmy.world
      link
      fedilink
      English
      15 months ago

      In my 18+ years as a PHP developer, I never once knew (at least afar as I can recall) that PHP supported NaN. TIL.