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

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

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

Okay