Is it possible to write strictly typed PHP code?

后端 未结 9 879
陌清茗
陌清茗 2020-12-14 15:34

For example, is it possible to write code like this:

int $x = 6;
str $y = \"hello world\";
bool $z = false;
MyObject $foo = new MyObject();

9条回答
  •  臣服心动
    2020-12-14 15:56

    You could use h2tp transpiler to transpile HACK code to PHP:

    You can do this thanks to Facebook Team and HACK Language.

    Visit http://hacklang.org and http://hhvm.com for more info.

    If you want to code directly in Hack + HHVM environment you can also use Facebook's internal IDE Nuclide

提交回复
热议问题