Update lib.php

Added __toString()