Conditionally define boolval for older PHP versions.