I left the PHP world for few years and I was working in C#.Net since then. I am thinking about diving into the PHP again and today I came across http://hhvm.com/ and it seems way more similar to C# than pure PHP.
So my question is what is the difference between Hack programming language and PHP?
This is a very old question, but as it's been reopened, an answer would likely help future readers. In order to understand how they're different, you first need to understand how they're similar.
Hack is derived from PHP. It was designed by Facebook during a time when PHP lacked various features now present in modern versions of PHP, such as return type declarations for functions, and is meant to run on the HHVM for performance improvements over PHP. It was also designed to be largely compatible with existing PHP scripts in order to keep their existing code functioning, allowing them to gradually migrate their pure PHP code over to Hack. Notably, however, there were some features that were intentionally not implemented in Hack for a variety of reasons (performance, security, legacy support, etc.).
Now with PHP 7 existing, the HHVM no longer officially supports PHP due to differences and incompatibilities between PHP and Hack. The two are, for all intents and purposes, completely different languages that just happen to have an older version of PHP as a common ancestor.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With