I think this is already quite concise compared to most languages. I donβt understand what you hope to achieve by making it even less legible.
One thing I would do is delete defined , leaving
$functionpointer ? $functionpointer->($value) : $value
as if $functionpointer was defined and is a valid subroutine reference, it will always be true
source share