In this second part of a series, I add a basic method to the “Url” class created in the first part. This method will be tasked with appending new parameters to its existing query string. Due to the immutable nature of the class, the method will return new “Url” objects, in this way demonstrating the actual functionality of the Value Object pattern when it comes to taking immutability to a more complex level.


Read the full article here: PHP: Adding Behavior to a URL Class

For more discussion go here: Blog Article Discussion