Mediaman Interview Question

How does the data flow in this PHP-Snippet work?