simulation for pub/sub algorithm by PHP