Created
November 30, 2015 14:14
-
-
Save ThijsFeryn/d36e1a81b88ddcc3a8ac to your computer and use it in GitHub Desktop.
PHP 7 return type declarations
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 | |
/** | |
* Return type declarations | |
*/ | |
//declare(strict_types=1); | |
function add(int $a, int $b): int{ | |
return (string)($a + $b); | |
} | |
var_dump(add(1,2)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment