$offset.'get'; } public function offsetSet($offset, $value) { $this->$offset = $value.'set'; } public function offsetUnset($offset) { $this->$offset = 'unset'; } } function f() { var_dump('f()'); return 1; } function test($a) { $a['foo'] .= f(); $a['bar'] += f(); $a['bar'] -= f(); $a['bar'] *= f(); $a['bar'] /= f(); $a['bar'] %= f(); $a['bar'] &= f(); $a['bar'] |= f(); $a['bar'] ^= f(); $a['bar'] <<= f(); $a['bar'] >>= f(); } test(new A);