4 ms·
I guess hack is not backward compatible with some older php code. Particularly code that mingles php and html together. For a lot of us this doesn't matter (fr
by acomjean 12y ago
I guess hack is not backward compatible with some older php code.
Particularly code that mingles php and html together. For a lot of us this doesn't matter (frameworks and templating engines), but a lot of tutorials mix the html and php.
Most frameworks work with hack now, so your right it would be easier if there where just 1 version of "php".
- Gigablah 12y agoHack has incompatibilities with some current PHP code too. Particularly the different syntax for generators (PHP 5.5) and the upcoming syntax for variadic functions (PHP 5.6).
- jwatzman 12y agoCan you elaborate on these incompatibilities, particularly generators? I work on the project and the only generator incompatibility I know of is that what PHP5 calls "Generator" we call "Continuation", but only since we haven't gotten around to renaming ours yet :) I'm also pretty sure HHVM supports 5.6 variadic functions in PHP code, or will very soon; the Hack typechecker currently does not, but that is strictly a missing feature, and something we do want to support.
- Gigablah 12y agoThere's already open issues in GitHub regarding the differences in generator syntax -- I commented in one: https://github.com/facebook/hhvm/issues/1787 https://github.com/facebook/hhvm/issues/1787 I guess the class has been renamed in trunk, but according to this, the syntax differences still remain: https://github.com/facebook/hhvm/issues/1871 https://github.com/facebook/hhvm/issues/1871 And while we're at it, might as well point out the missing Closure::bind and Closure::bindTo from PHP 5.4: https://github.com/facebook/hhvm/issues/1203 https://github.com/facebook/hhvm/issues/1203