What could be better than chainable operators in jQuery, .addClass("beautiful").show("slow")-style? Almost nothing, but adding those to PHP would make code cleaner and life easier.

At first sight, implementing these looks almost impossible, but after a quick look at extensions we notice that SPL could offer something similar, if combined with magic methods. Let’s implement ArrayAccess interface and see how it works: