I have learned so far that PHP lacks comma operator (I am not here for opinions if it is good or bad). Since I I fall into pattern of such expressions:
($tmp = bar(), foo($tmp), $tmp)
I can substitute the comma operator with calling a custom function which takes value and lambda, and returns the value.
But I wonder -- maybe PHP 7 brought some new feature that makes substitution easier or allows to substitute all forms of comma operator expressions?
Not quite, but since PHP 7 you can easily create and call a lambda function at the same time, thanks to the new AST:
(function() { $tmp = bar(); foo($tmp); return $tmp; })();