--TEST-- Scalar type - default via constants --FILE-- getMessage(), "\n"; } echo "Testing int with null null constant" . PHP_EOL; try { var_dump(int_val_default_null(null)); } catch (TypeError $e) { echo $e->getMessage(), "\n"; } echo "Testing nullable int with default null constant" . PHP_EOL; var_dump(nullable_int_val_default_null()); echo "Testing nullable int with null null constant" . PHP_EOL; var_dump(nullable_int_val_default_null(null)); ?> --EXPECTF-- Testing int val int(10) Testing float val float(10.5) Testing string val string(14) "this is a test" Testing int add val int(25) Testing float add val float(10.7) Testing string add val string(14) "this is a test" Testing int with default null constant int_val_default_null(): Argument #1 ($a) must be of type int, null given, called in %s on line %d Testing int with null null constant int_val_default_null(): Argument #1 ($a) must be of type int, null given, called in %s on line %d Testing nullable int with default null constant NULL Testing nullable int with null null constant NULL