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

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

Image of Timescale

Timescale ā€“ the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

šŸ‘‹ Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay