Let's say I have a class that implements ArrayAccess but doesn't allow the addition of new data. You can set already existing values, but you can't add to the size.
$arrayAccessible[1] = new StdClass(); //okay
$arrayAccessible[] = new StdClass(); //should throw an exception
What exception type should I throw? I do have SPL exception types available and should use them if it makes sense. The best I can think of is perhaps BadFunctionCallException or BadMethodCallException.
If there isn't a good one to throw, perhaps I'll make UnsupportedOperationException or the like. However, that is definitely not something I'd like to do. That would be incredibly hard to add in this project.