Jeremy Newman : update for PHP7 compat