Skip to content

Instantly share code, notes, and snippets.

@jazzdan
Last active August 29, 2015 14:19
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 jazzdan/9480e83bd48c3c9b95a2 to your computer and use it in GitHub Desktop.
Save jazzdan/9480e83bd48c3c9b95a2 to your computer and use it in GitHub Desktop.
<?php
function add(int $a, int $b): int {
myLog($a + $b);
return $a + $b;
}
<?php
declare(strict_types=1);
function myLog(string $message): string {
return $message;
}
<?php
require 'add.php';
require 'logger.php';
$result = add(1, 3);
echo $result;
$ php main.php
4
$ hhvm -vEval.EnableHipHopSyntax=true main.php
Catchable fatal error: Argument 1 passed to myLog() must be an instance of string, int given in /home/vagrant/separate_files_mixed/logger.php on line 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment