DEV Community

Cover image for CFDump ShowUDFs Behavior
James Moberg
James Moberg

Posted on

CFDump ShowUDFs Behavior

I was writing some unit tests to identify the output of CFDump under different conditions and discovered that Adobe and Lucee treat the showUDFs parameter differently. I also use 3rdparty CF_Dump since it provides consistent behavior between CFML platforms. Since I've written my own internal Dumplite CFTag/CFC, I wanted to evaluate how it was already being supported before I updated how it worked.

Adobe:

  • Hides struct keys
  • Shows array elements with UDF (is this a bug?)

Lucee:

  • Displays struct value as <UDF>
  • Displays array element as <UDF>

CF_Dump

  • Displays struct key with empty value
  • Displays array element with empty value
<cfscript>
function myUDF(){return now();}

test = [
    a: [1, myUDF, 3]
    ,b: myUDF
];

writeDump(var=test, showUDFs=false, label="showUDFs=false");
writeDump(var=test, showUDFs=true, label="showUDFs=true");

</cfscript>
Enter fullscreen mode Exit fullscreen mode

Top comments (0)