3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?hh // Hack functions are annotated with types. function my_negation(bool $x): bool { return !$x; } // FIXME: annotate this function parameter // and return with the type 'int'. function add_one(int $x): int { return $x+1; } echo add_one(3);
based on eNaPg
Output for hhvm-3.10.0 - 3.12.0
4
Output for 5.3.0 - 5.4.32
<?hh // Hack functions are annotated with types. function my_negation(bool $x): bool { return !$x; } // FIXME: annotate this function parameter // and return with the type 'int'. function add_one(int $x): int { return $x+1; } echo add_one(3);