http://coldfusion.com logo
#cfml-general
Title
# cfml-general
a

Adam Cameron

03/02/2022, 3:36 PM
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

sknowlton

03/02/2022, 5:11 PM
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

Mark Takata (Adobe)

03/02/2022, 5:48 PM
if I have enough beer I return null
💯 1
a

Adam Cameron

03/02/2022, 6:14 PM
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.
2 Views