That is what I thought I did in the article, I guess I failed.
Can you give me a specific idea what you are having trouble understanding, so that I don't have to write another article here, just with a different example?
If you are not talking about nested anonymous classes, then make sure you have read this article on the anonymous class basics...
phpclasses.org/blog/post/318-PHP-7-
...
Dave