Using SPL exceptions