Skip to content

Instantly share code, notes, and snippets.

@ThijsFeryn
Created November 30, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThijsFeryn/8a495703cffdf2b3fda5 to your computer and use it in GitHub Desktop.
Save ThijsFeryn/8a495703cffdf2b3fda5 to your computer and use it in GitHub Desktop.
PHP 7 scalar type hints
<?php
/**
* Scalar type declarations
*/
//declare(strict_types=1);
function add(int $a, int $b) {
return $a + $b;
}
var_dump(add(1,2));
var_dump(add("1","2"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment