The following program
---8<--- class foo { string `+(mixed ... args) { return "left:"+sizeof(args); } string ``+(mixed ... args) { return "right:"+sizeof(args); } }
int main() { foo x = foo(); write("%s\n%s\n%s\n", x+x+x+x+x, (((x+x)+x)+x)+x, x+(x+(x+(x+x)))); return 0; } ---8<---
gives the output
left:4 left:4 left:1
(tested in Pike 7.8.350). Shouldn't the last line be "right:4"? We seem to be missing an opportunity for optimization here.