You've used one interesting trick, but I bet you haven't noticed that. Pay attention to the `$url_parser->urlComponents` code. Here from within one `UrlParser` object you're accessing protected property of another `UrlParser` object. This shouldn't work because only class itself can access it.

But interesting thing in PHP (same in Java) is, that when within a class you can access protected properties of any object of same class, because there is no way to distinguish them (both class instances).