Status/Resolution/Reason: Closed/Fixed/Fixed
Reporter/Name(from Bugbase): Samuel Knowlton / Samuel Knowlton ()
Created: 03/13/2017
Components: Language
Versions: 11.0
Failure Type: Incorrectly functioning
Found In Build/Fixed In Build: 11,0,11,301867 / 2018,0,0,308513
Priority/Frequency: Normal / All users will encounter
Locale/System: English / Windows 10 64 bit
Vote Count: 3
Problem Description: Using more than one elvis operator in a statement with a failsafe option produces UNDEFINED rather than the failsafe option. This works correctly in ACF11.
Steps to Reproduce:
(code snippets courtesy of @adam_cameron and @ryanguill - uncomment a, b, or c, but the snippet as-is will produce the buggy result)
<cfscript>
//a = "eh?";
//b = "be!";
//c = "see?";
//foo = (a ?: b) ?: c;
foo = a ?: (b ?: (c ?: "failsafe"));
writeDump(foo);
</cfscript>
Actual Result: Variable FOO is UNDEFINED
Expected Result: "failsafe"
Any Workarounds:
Attachments:
Comments: