DEV Community

Cover image for CFDump ShowUDFs Behavior
James Moberg
James Moberg

Posted on

2 2

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

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay