rfc:nullable-casting
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
rfc:nullable-casting [2019/04/09 05:54] – Add link to Annoucement and discussion thread guilliamxavier | rfc:nullable-casting [2019/04/21 09:03] (current) – Add Discussion section guilliamxavier | ||
---|---|---|---|
Line 175: | Line 175: | ||
* Working prototype: https:// | * Working prototype: https:// | ||
+ | |||
+ | ===== Discussion ===== | ||
+ | |||
+ | ==== "Not 100% needed" | ||
+ | |||
+ | Current alternatives: | ||
+ | * Use a test (ternary conditional operator or '' | ||
+ | * Write (and [auto]load) custom casting functions | ||
+ | * Disable (i.e. do not enable) strict typing mode in the concerned file //(not strictly equivalent, e.g. for '' | ||
+ | |||
+ | ==== "A cast where you can't be sure of what you'll get back" ==== | ||
+ | |||
+ | "I understand the use-case for when you want to pass something to a nullable parameter, but if you think about this cast in isolation, it hardly makes sense." | ||
+ | |||
+ | ==== "What about e.g. nullable_intval()?" | ||
+ | |||
+ | But we're missing " | ||
+ | |||
+ | ==== Fallible Casting ==== | ||
+ | |||
+ | One might expect to also have e.g. '' | ||
+ | |||
+ | ==== Alternative syntax ==== | ||
+ | |||
+ | E.g. "'' | ||
===== References ===== | ===== References ===== |
rfc/nullable-casting.1554789241.txt.gz · Last modified: 2019/04/09 05:54 by guilliamxavier