Fixed
Details
Details
Assignee
Michael Offner
Michael OffnerReporter
Adam Cameron
Adam CameronLabels
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Fix versions
Affects versions
Priority
Created 1 February 2015 at 16:36
Updated 24 September 2021 at 13:14
Resolved 8 June 2016 at 05:49
Copied from https://issues.jboss.org/browse/RAILO-2580
See http://cfmlblog.adamcameron.me/2013/08/thinking-about-operators-in-cfml.html
This is best demonstrated with an example:
a = { b = { c = { d = 1 } } }; writeOutput(a?.b?.c?.d); // 1 writeOutput(a?.e?.c?.d); // null writeOutput(a.e.c.d); // ERROR
So rather than erroring because a.e doesn't exist, it gracefully returns null. Nice. This saves a lot of sequential
structKeyExists()
calls, or (grim) anisDefined()
call.