--TEST-- Union of two intersection type --FILE-- getMessage(), \PHP_EOL; } try { bar2(); } catch (\TypeError $e) { echo $e->getMessage(), \PHP_EOL; } ?> --EXPECTF-- object(A)#%d (0) { } object(A)#%d (0) { } object(B)#%d (0) { } object(B)#%d (0) { } bar1(): Return value must be of type (X&Y)|(W&Z), C returned bar2(): Return value must be of type (W&Z)|(X&Y), C returned