Page MenuHomePhorge

function id($x)
libphutil Technical Documentation (Core Utilities)

Identity function, returns its argument unmodified.

This is useful almost exclusively as a workaround to an oddity in the PHP grammar -- this is a syntax error:

new Thing()->doStuff();

...but this works fine:

id(new Thing())->doStuff();
Parameters
wild$xAnything.
Return
wildUnmodified argument.