1 2 3 4 5 6 7
<?php function throw_if_null($arg) { if ($arg === null) throw new Exception('argument is null'); } ?>