This will not work for ArrayAccess (your test does not catch it because ArrayObject has a special behavior, not ArrayAccess)