The observer pattern in php