Skip to content

Instantly share code, notes, and snippets.

@ircmaxell
Created July 11, 2015 00:06
Show Gist options
  • Save ircmaxell/3cd3e80c6f17711dab40 to your computer and use it in GitHub Desktop.
Save ircmaxell/3cd3e80c6f17711dab40 to your computer and use it in GitHub Desktop.
Tuli output
<?php
$a = 1.0;
$b = 2;
$c = foo($a, $b);
$d = foo($b, $c);
function foo(int $a, int $b): int {
if ($a > $b) {
return $a + $b + 0.5;
}
}
$ bin/tuli analyze code.php
Analyzing code.php
Determining Variable Types
Round 1 (15 unresolved variables out of 20)
.
Detecting Type Conversion Issues
Type mismatch on foo() argument 0, found float expecting int code.php:6
Type mismatch on foo() return value, found float expecting int code.php:12
Default return found for non-null type int code.php:10
Done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment