Allow to use closure in QueryExpression

Allow to use closure in QueryExpression. Fixes #3852
Added test case for closures in QueryExpression.
Fixed comment
Update TupleComparisonTest.php
Merge pull request #3853 from MichalWadowski/patch-1

Allow to use closure in QueryExpression. Fixes #3852