PHP function to evaluate comparisons between two values, with debug logging
given your function's purpose is to return the calculation result, I would return the expression result right away, especially given return makes break unnecessary as well

private function performComparison($operator, $value_allowed, $value_entered)
{
    switch($operator) {
        case '&gt;':
            return ($value_entered &gt;  $value_allowed);
        case '&gt;=':
            return ($value_entered &gt;= $value_allowed);
        case '&lt;':
            return ($value_entered &lt;  $value_allowed);
        case '&lt;=':
            return ($value_entered &lt;= $value_allowed);
        case '=':
            return ($value_entered == $value_allowed);
        default:
            throw new InvalidArgumentException("Invalid operator");
    }
}


The code above is both concise and readable, it takes one no problem to gist the function's meaning and purpose. 

Whereas any debugging should be done elsewhere. If you need any debugging for this function, create another one encapsulating the current function's call.

    private function debugPerformComparison($element, $operator, $value_allowed, $value_entered)
    {
        $result = $this-&gt;performComparison($operator, $value_allowed, $value_entered);
        $dateformat = 'n/j/Y';
        $debug = [
            'element' =&gt; $element, 
            'operator' =&gt; $operator, 
            'value allowed' =&gt; is_a($value_allowed, 'DateTime') ? $value_allowed-&gt;format($dateformat) : $value_allowed, 
            'value entered' =&gt; is_a($value_entered, 'DateTime') ? $value_entered-&gt;format($dateformat) : $value_entered, 
            'result' =&gt; $result,
        ];
        echo '&lt;pre&gt;'.var_export($debug,1).'&lt;/pre&gt;';
        return $result;
    }


Regarding anonymous function-based version, a concise version shouldn't be less readable in the first place. Any code improvements should improve the readability, by means of removing unnecessary parts, not worsen it. And the said version is extremely hard to read.