Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.