Other than just because "yer wrong mate", why did ...
# cfml-general
a
Other than just because "yer wrong mate", why did I think CFML had nullable return types these days? eg:
public ?Something function getSomethingMaybe()
🤷 1
I'm poss just having PHP flashbacks I guess (ref: https://www.php.net/manual/en/migration71.new-features.php)
s
Because it should have them? 🙂
#1 reason why we have so many methods without declared return types
public beerOrNull function
where we just don't get beer as often as we'd like
m
if I have enough beer I return null
💯 1
a
It's not something I need often (hence really only trying it today), but I'm combatting some less-than-ideal code, and it would have helped. I hate
returntype="any"
and having to hint it.
Ah. I know. I was remembering that CFML added array-of-types ages ago, and getting wires crossed with PHP adding the nullable ones recently.