Comment

Comment by veonik

Yep, that whole example after the float cast is bit silly. After the cast, the value can never be an empty string, or null. Not to mention, comparing a floating point value to an arbitrary, literal value (of zero in this case) is potentially problematic [1].

[1]: See the warning on this page, this applies to all languages with floating point arithmetic. https://www.php.net/manual/en/language.types.float.php

parent veonik 2 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton