Created
November 6, 2015 20:25
-
-
Save nubeiro/48bc2afd2afa0d835a7e to your computer and use it in GitHub Desktop.
Testing default scalar type hints.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function concatStrings(string $a, string $b) { | |
return $a . ' - ' . $b; | |
} | |
function sum(int $a, int $b) { | |
return $a + $b; | |
} | |
echo sum("1000", "110.33") . PHP_EOL; | |
// output is | |
// 1110 | |
echo concatStrings(1, 222) . PHP_EOL; | |
// output is: | |
// 1 - 222 | |
echo PHP_EOL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment